[clutter] gdk: Use X11 API only when running under X11



commit 365bd482fbce9ae61e810878afe685d21e6a801d
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Jul 9 14:34:11 2015 +0100

    gdk: Use X11 API only when running under X11
    
    Avoid using GdkX11Screen API when the GDK backend being used is not the
    X11 one.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752143

 clutter/gdk/clutter-backend-gdk.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/clutter/gdk/clutter-backend-gdk.c b/clutter/gdk/clutter-backend-gdk.c
index 01ba8cb..240829a 100644
--- a/clutter/gdk/clutter-backend-gdk.c
+++ b/clutter/gdk/clutter-backend-gdk.c
@@ -534,11 +534,12 @@ clutter_gdk_get_visual (void)
   g_assert (screen != NULL);
 
 #if defined(GDK_WINDOWING_X11) && defined(COGL_HAS_XLIB_SUPPORT)
-  {
-    XVisualInfo *xvisinfo = cogl_clutter_winsys_xlib_get_visual_info ();
-    if (xvisinfo != NULL)
-      return gdk_x11_screen_lookup_visual (screen, xvisinfo->visualid);
-  }
+  if (GDK_IS_X11_SCREEN (screen))
+    {
+      XVisualInfo *xvisinfo = cogl_clutter_winsys_xlib_get_visual_info ();
+      if (xvisinfo != NULL)
+        return gdk_x11_screen_lookup_visual (screen, xvisinfo->visualid);
+    }
 #endif
 
   if (gdk_screen_get_rgba_visual (screen) != NULL)


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