[metacity] Replace deprecated GDK symbols



commit 15f273e77d78f4cad5efdcb849a407014e526b19
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Jun 14 12:46:22 2010 +0200

    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=572332

 src/ui/frames.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 86d5d76..4e60197 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -2014,22 +2014,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;
       
@@ -2039,9 +2043,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;
     }



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