[clutter-gtk] embed: Check whether we're running on X11 at run-time



commit c3807e2f791d808f11e3ccaf8fcf3817f41c3b40
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Mar 13 15:04:46 2013 +0100

    embed: Check whether we're running on X11 at run-time
    
    Rather than assuming a single backend.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695685

 clutter-gtk/gtk-clutter-embed.c |   41 ++++++++++++++++++++++++++------------
 1 files changed, 28 insertions(+), 13 deletions(-)
---
diff --git a/clutter-gtk/gtk-clutter-embed.c b/clutter-gtk/gtk-clutter-embed.c
index f2c9c73..935bf5a 100644
--- a/clutter-gtk/gtk-clutter-embed.c
+++ b/clutter-gtk/gtk-clutter-embed.c
@@ -710,22 +710,37 @@ gtk_clutter_embed_style_updated (GtkWidget *widget)
    * a GtkClutterEmbed will not look completely alien
    */
   clutter_settings = clutter_settings_get_default ();
-  g_object_set (G_OBJECT (clutter_settings),
-                "font-name", font_name,
-                "double-click-time", double_click_time,
-                "double-click-distance", double_click_distance,
-#if defined(GDK_WINDOWING_X11) && defined(CLUTTER_WINDOWING_X11) 
-                "font-antialias", xft_antialias,
-                "font-dpi", xft_dpi,
-                "font-hinting", xft_hinting,
-                "font-hint-style", xft_hintstyle,
-                "font-subpixel-order", xft_rgba,
+
+#if defined(GDK_WINDOWING_X11) && defined(CLUTTER_WINDOWING_X11)
+  if (GDK_IS_X11_SCREEN (screen))
+    {
+      g_object_set (G_OBJECT (clutter_settings),
+                    "font-name", font_name,
+                    "double-click-time", double_click_time,
+                    "double-click-distance", double_click_distance,
+                    "font-antialias", xft_antialias,
+                    "font-dpi", xft_dpi,
+                    "font-hinting", xft_hinting,
+                    "font-hint-style", xft_hintstyle,
+                    "font-subpixel-order", xft_rgba,
+                    NULL);
+    }
+  else
 #endif
-                NULL);
+    {
+      g_object_set (G_OBJECT (clutter_settings),
+                    "font-name", font_name,
+                    "double-click-time", double_click_time,
+                    "double-click-distance", double_click_distance,
+                    NULL);
+    }
 
 #if defined(GDK_WINDOWING_X11) && defined(CLUTTER_WINDOWING_X11)
-  g_free (xft_hintstyle);
-  g_free (xft_rgba);
+  if (GDK_IS_X11_SCREEN (screen))
+    {
+      g_free (xft_hintstyle);
+      g_free (xft_rgba);
+    }
 #endif
 
   g_free (font_name);


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