[clutter-gtk/wip/wayland: 4/5] util: Add Wayland support to init



commit 8579a1948bc33314f631fbc0ca268036e5c4f1f2
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 12 15:13:15 2013 +0100

    util: Add Wayland support to init
    
    Pretty useless, but gets the code running a little bit further.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695737
    
    wayland: Integrate GTK+ and Clutter's display
    
    Tell Clutter to use the display from GTK and in order to avoid deadlocks
    on the Wayland socket disable Clutter's polling on that socket.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695737

 clutter-gtk/gtk-clutter-util.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/clutter-gtk/gtk-clutter-util.c b/clutter-gtk/gtk-clutter-util.c
index d4a9fa5..1c989a7 100644
--- a/clutter-gtk/gtk-clutter-util.c
+++ b/clutter-gtk/gtk-clutter-util.c
@@ -31,6 +31,10 @@
 #include <gdk/gdkwin32.h>
 #endif
 
+#if defined(CLUTTER_WINDOWING_WAYLAND)
+#include <gdk/gdkwayland.h>
+#endif
+
 /**
  * SECTION:gtk-clutter-util
  * @Title: Utility Functions
@@ -96,6 +100,16 @@ post_parse_hook (GOptionContext  *context,
     }
   else
 #endif
+#if defined(GDK_WINDOWING_WAYLAND) && defined(CLUTTER_WINDOWING_WAYLAND)
+  if (clutter_check_windowing_backend (CLUTTER_WINDOWING_WAYLAND) &&
+      GDK_IS_WAYLAND_DISPLAY (display))
+    {
+      /* let GTK+ be in charge of the event handling */
+      clutter_wayland_disable_event_retrieval ();
+      clutter_wayland_set_display (gdk_wayland_display_get_wl_display (display));
+    }
+  else
+#endif
     g_error ("*** Unsupported backend.");
 
   /* this is required since parsing clutter's option group did not
@@ -202,6 +216,14 @@ gtk_clutter_init (int    *argc,
     clutter_win32_disable_event_retrieval ();
 #endif
 
+#if defined(GDK_WINDOWING_WAYLAND) && defined(CLUTTER_WINDOWING_WAYLAND)
+  if (clutter_check_windowing_backend (CLUTTER_WINDOWING_WAYLAND))
+    {
+      /* let GTK+ be in charge of the event handling */
+      /* FIXME: disable event retrieval */
+    }
+#endif
+
   /* We disable clutter accessibility support in order to not
    * interfere with gtk accessibility support.
    */


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