[vte/rendering-cleanup] Fix build with gtk 3 rendering cleanup branch



commit d64fe5172ca0b59fd1073d91cde6e687f8912e94
Author: Christian Persch <chpe gnome org>
Date:   Sat Sep 11 12:39:03 2010 +0200

    Fix build with gtk 3 rendering cleanup branch

 src/vte.c    |   22 ++++++++++++++++------
 src/vteapp.c |   10 ++++++++++
 src/vtebg.c  |    4 ++++
 3 files changed, 30 insertions(+), 6 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index bcbd655..c6d0235 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -4894,8 +4894,11 @@ vte_translate_national_ctrlkeys (GdkEventKey *event)
 	GdkModifierType consumed_modifiers;
 	GdkKeymap *keymap;
 
-	keymap = gdk_keymap_get_for_display (
-			gdk_drawable_get_display (event->window));
+#if GTK_CHECK_VERSION (2, 90, 8)
+        keymap = gdk_keymap_get_for_display(gdk_window_get_display (event->window));
+#else
+	keymap = gdk_keymap_get_for_display(gdk_drawable_get_display (event->window));
+#endif
 
 	gdk_keymap_translate_keyboard_state (keymap,
 			event->hardware_keycode, event->state,
@@ -4911,16 +4914,19 @@ vte_translate_national_ctrlkeys (GdkEventKey *event)
 
 static void
 vte_terminal_read_modifiers (VteTerminal *terminal,
-			     GdkEvent    *event)
+			     GdkEvent *event)
 {
 	GdkModifierType modifiers;
 
 	/* Read the modifiers. */
 	if (gdk_event_get_state((GdkEvent*)event, &modifiers)) {
 		GdkKeymap *keymap;
-		keymap = gdk_keymap_get_for_display (
-				gdk_drawable_get_display (((GdkEventAny *)event)->window));
-		gdk_keymap_add_virtual_modifiers (keymap, &modifiers);
+#if GTK_CHECK_VERSION (2, 90, 8)
+                keymap = gdk_keymap_get_for_display(gdk_window_get_display(((GdkEventAny*)event)->window));
+#else
+                keymap = gdk_keymap_get_for_display(gdk_drawable_get_display(((GdkEventAny*)event)->window));
+#endif
+                gdk_keymap_add_virtual_modifiers (keymap, &modifiers);
 		terminal->pvt->modifiers = modifiers;
 	}
 }
@@ -8698,7 +8704,9 @@ vte_terminal_realize(GtkWidget *widget)
 	attributes.height = allocation.height;
 	attributes.wclass = GDK_INPUT_OUTPUT;
 	attributes.visual = gtk_widget_get_visual (widget);
+#if !GTK_CHECK_VERSION (2, 90, 8)
 	attributes.colormap = gtk_widget_get_colormap (widget);
+#endif
 	attributes.event_mask = gtk_widget_get_events(widget) |
 				GDK_EXPOSURE_MASK |
 				GDK_VISIBILITY_NOTIFY_MASK |
@@ -8715,7 +8723,9 @@ vte_terminal_realize(GtkWidget *widget)
 	attributes_mask = GDK_WA_X |
 			  GDK_WA_Y |
 			  (attributes.visual ? GDK_WA_VISUAL : 0) |
+#if !GTK_CHECK_VERSION (2, 90, 8)
 			  (attributes.colormap ? GDK_WA_COLORMAP : 0) |
+#endif
 			  GDK_WA_CURSOR;
 
 	window = gdk_window_new (gtk_widget_get_parent_window (widget),
diff --git a/src/vteapp.c b/src/vteapp.c
index 87edb9e..14cce36 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -538,7 +538,11 @@ int
 main(int argc, char **argv)
 {
 	GdkScreen *screen;
+#if GTK_CHECK_VERSION (2, 90, 8)
+        GdkVisual *visual;
+#else
 	GdkColormap *colormap;
+#endif
 	GtkWidget *window, *widget,*hbox = NULL, *scrollbar, *scrolled_window = NULL;
 	VteTerminal *terminal;
 	char *env_add[] = {
@@ -788,9 +792,15 @@ main(int argc, char **argv)
 
 	/* Set ARGB colormap */
 	screen = gtk_widget_get_screen (window);
+#if GTK_CHECK_VERSION (2, 90, 8)
+        visual = gdk_screen_get_rgba_visual(screen);
+        if (visual)
+                gtk_window_set_visual(GTK_WINDOW(window), visual);
+#else
 	colormap = gdk_screen_get_rgba_colormap (screen);
 	if (colormap)
 	    gtk_widget_set_colormap(window, colormap);
+#endif
 
         if (use_scrolled_window) {
                 scrolled_window = gtk_scrolled_window_new (NULL, NULL);
diff --git a/src/vtebg.c b/src/vtebg.c
index c9f472c..503d1dc 100644
--- a/src/vtebg.c
+++ b/src/vtebg.c
@@ -240,7 +240,11 @@ vte_bg_get_for_screen(GdkScreen *screen)
 		window = gdk_screen_get_root_window(screen);
                 pvt->native.window = window;
                 pvt->native.native_window = gdk_x11_drawable_get_xid(window);
+#if GTK_CHECK_VERSION (2, 90, 8)
+                pvt->native.display = gdk_window_get_display(window);
+#else
                 pvt->native.display = gdk_drawable_get_display(GDK_DRAWABLE(window));
+#endif
                 pvt->native.native_atom = gdk_x11_get_xatom_by_name_for_display(pvt->native.display, "_XROOTPMAP_ID");
                 pvt->native.atom = gdk_x11_xatom_to_atom_for_display(pvt->native.display, pvt->native.native_atom);
 		pvt->root_surface = vte_bg_root_surface(bg);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]