From 4544fe7571b4ed3e1a5e20b3013f44ff4e04e6f9 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 19 Aug 2010 09:28:46 +0200 Subject: [PATCH] Fix build against gtk+ older than 2.21.6. The gdk_window_get_background_pattern() function copied from GDK and introduced in commit 0839c10 has a small syntax error and uses a private API (_gdk_drawable_ref_cairo_surface()). This patch imports the missing API and fixes the syntax error. https://bugzilla.gnome.org/show_bug.cgi?id=626583 --- src/ui/frames.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ui/frames.c b/src/ui/frames.c index 5ec5b3a01..27928f1d3 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -2006,6 +2006,14 @@ meta_frames_destroy_event (GtkWidget *widget, #if !GTK_CHECK_VERSION(2,21,6) /* Copied from GDK */ +static cairo_surface_t * +_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable) +{ + g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL); + + return GDK_DRAWABLE_GET_CLASS (drawable)->ref_cairo_surface (drawable); +} + static cairo_pattern_t * gdk_window_get_background_pattern (GdkWindow *window) { @@ -2033,7 +2041,8 @@ gdk_window_get_background_pattern (GdkWindow *window) g_object_unref); } else - pattern = + { + pattern = cairo_pattern_create_rgb (private->bg_color.red / 65535., private->bg_color.green / 65535., private->bg_color.blue / 65535.);