From c65a24486dec836efdd20fe10d2dcb866a3c0c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 14 Jun 2010 12:46:22 +0200 Subject: [PATCH] Replace deprecated GDK symbols The fix depends on new API added in this cycle, so the required GTK+ version is bumped to 2.21.1. https://bugzilla.gnome.org/show_bug.cgi?id=587991 --- configure.in | 2 +- src/ui/frames.c | 28 +++++++++++++++++----------- src/ui/ui.c | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/configure.in b/configure.in index eff4b35c7..836ac6cc3 100644 --- a/configure.in +++ b/configure.in @@ -124,7 +124,7 @@ if test "x$GCC" = "xyes"; then fi changequote([,])dnl -MUTTER_PC_MODULES='gtk+-2.0 >= 2.18 pango >= 1.2.0' +MUTTER_PC_MODULES='gtk+-2.0 >= 2.21.1 pango >= 1.2.0' AC_ARG_ENABLE(gconf, AC_HELP_STRING([--disable-gconf], diff --git a/src/ui/frames.c b/src/ui/frames.c index 0ba4d6e5e..a0387c118 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -2006,22 +2006,26 @@ meta_frames_destroy_event (GtkWidget *widget, static GdkGC * get_bg_gc (GdkWindow *window, int x_offset, int y_offset) { - GdkWindowObject *private = (GdkWindowObject *)window; + GdkWindow *parent = gdk_window_get_parent (window); + GdkPixmap *back_pixmap; + gboolean parent_relative; guint gc_mask = 0; GdkGCValues gc_values; - if (private->bg_pixmap == GDK_PARENT_RELATIVE_BG && private->parent) + gdk_window_get_back_pixmap (window, &back_pixmap, &parent_relative); + if (parent_relative && parent) { - return get_bg_gc (GDK_WINDOW (private->parent), - x_offset + private->x, - y_offset + private->y); + gint window_x, window_y; + + gdk_window_get_position (window, &window_x, &window_y); + return get_bg_gc (parent, + x_offset + window_x, + y_offset + window_y); } - else if (private->bg_pixmap && - private->bg_pixmap != GDK_PARENT_RELATIVE_BG && - private->bg_pixmap != GDK_NO_BG) + else if (back_pixmap) { gc_values.fill = GDK_TILED; - gc_values.tile = private->bg_pixmap; + gc_values.tile = back_pixmap; gc_values.ts_x_origin = x_offset; gc_values.ts_y_origin = y_offset; @@ -2031,9 +2035,11 @@ get_bg_gc (GdkWindow *window, int x_offset, int y_offset) } else { + GdkColor bg_color; GdkGC *gc = gdk_gc_new (window); - gdk_gc_set_foreground (gc, &(private->bg_color)); + gdk_window_get_background (window, &bg_color); + gdk_gc_set_foreground (gc, &bg_color); return gc; } @@ -2550,7 +2556,7 @@ meta_frames_set_window_background (MetaFrames *frames, /* Set A in ARGB to window_background_alpha, if we have ARGB */ visual = gtk_widget_get_visual (GTK_WIDGET (frames)); - if (visual->depth == 32) /* we have ARGB */ + if (gdk_visual_get_depth (visual) == 32) /* we have ARGB */ { color.pixel = (color.pixel & 0xffffff) & style->window_background_alpha << 24; diff --git a/src/ui/ui.c b/src/ui/ui.c index a2d0ada39..8c3800219 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -475,7 +475,7 @@ get_cmap (GdkPixmap *pixmap) /* Be sure we aren't going to blow up due to visual mismatch */ if (cmap && - (gdk_colormap_get_visual (cmap)->depth != + (gdk_visual_get_depth (gdk_colormap_get_visual (cmap)) != gdk_drawable_get_depth (pixmap))) { cmap = NULL;