[clutter-gtk] gdk-clutter-util: Add Wayland support to init



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

    gdk-clutter-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

 clutter-gtk/gtk-clutter-util.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/clutter-gtk/gtk-clutter-util.c b/clutter-gtk/gtk-clutter-util.c
index db3ff09..1a3b398 100644
--- a/clutter-gtk/gtk-clutter-util.c
+++ b/clutter-gtk/gtk-clutter-util.c
@@ -23,6 +23,10 @@
 #include <clutter/win32/clutter-win32.h>
 #endif
 
+#if defined(CLUTTER_WINDOWING_WAYLAND)
+#include <clutter/wayland/clutter-wayland.h>
+#endif
+
 #if defined(GDK_WINDOWING_X11)
 #include <gdk/gdkx.h>
 #endif
@@ -31,6 +35,10 @@
 #include <gdk/gdkwin32.h>
 #endif
 
+#if defined(GDK_WINDOWING_WAYLAND)
+#include <gdk/gdkwayland.h>
+#endif
+
 /**
  * SECTION:gtk-clutter-util
  * @Title: Utility Functions
@@ -91,6 +99,17 @@ gtk_clutter_init_internal (void)
     }
   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.");
 
   /* We disable clutter accessibility support in order to not


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