summaryrefslogtreecommitdiff
path: root/src/ui/frames.c
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2010-06-14 12:46:22 +0200
committerThomas Thurman <tthurman@gnome.org>2010-07-14 08:14:03 -0400
commit15f273e77d78f4cad5efdcb849a407014e526b19 (patch)
tree92b8c90540e806f7936a514f96f511c4529a3554 /src/ui/frames.c
parentde889d5911ff882736de18efdc070a97a33ee458 (diff)
downloadmetacity-15f273e77d78f4cad5efdcb849a407014e526b19.tar.gz
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
Diffstat (limited to 'src/ui/frames.c')
-rw-r--r--src/ui/frames.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 86d5d76b..4e601973 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;
}