[clutter-gtk] util: Run-time check the backend used on init



commit 8274daa4f35051b3627fd83a2b06af81aaf046b6
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 12 15:11:11 2013 +0100

    util: Run-time check the backend used on init
    
    Otherwise we could potentially try to run the GDK, X11 and
    Wayland functions on startup.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695685

 clutter-gtk/gtk-clutter-util.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/clutter-gtk/gtk-clutter-util.c b/clutter-gtk/gtk-clutter-util.c
index 323ae39..e9fed7b 100644
--- a/clutter-gtk/gtk-clutter-util.c
+++ b/clutter-gtk/gtk-clutter-util.c
@@ -185,21 +185,26 @@ gtk_clutter_init (int    *argc,
     return CLUTTER_INIT_ERROR_UNKNOWN;
 
 #if defined(CLUTTER_WINDOWING_GDK)
-  clutter_gdk_disable_event_retrieval ();
+  if (clutter_check_windowing_backend (CLUTTER_WINDOWING_GDK))
+    clutter_gdk_disable_event_retrieval ();
 #endif
 
 #if defined(GDK_WINDOWING_X11) && defined(CLUTTER_WINDOWING_X11)
-  clutter_x11_enable_xinput ();
+  if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
+    {
+      clutter_x11_enable_xinput ();
 
-  clutter_x11_set_use_argb_visual (TRUE);
+      clutter_x11_set_use_argb_visual (TRUE);
 
-  clutter_x11_set_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+      clutter_x11_set_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
 
-  clutter_x11_disable_event_retrieval ();
+      clutter_x11_disable_event_retrieval ();
+    }
 #endif
 
 #if defined(CLUTTER_WINDOWING_WIN32)
-  clutter_win32_disable_event_retrieval ();
+  if (clutter_check_windowing_backend (CLUTTER_WINDOWING_WIN32))
+    clutter_win32_disable_event_retrieval ();
 #endif
 
   return clutter_init (argc, argv);


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