[mutter] Fix build against gtk+ older than 2.21.6.



commit 4544fe7571b4ed3e1a5e20b3013f44ff4e04e6f9
Author: Thierry Reding <thierry reding avionic-design de>
Date:   Thu Aug 19 09:28:46 2010 +0200

    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 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 5ec5b3a..27928f1 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.);



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