[totem] main: Bring back video inside the window under Wayland



commit 6051dd76ac5e1738e00cbb677aeadea32e3df3be
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Aug 24 16:56:36 2015 +0200

    main: Bring back video inside the window under Wayland
    
    Working around the lack of subsurface support in clutter's GDK backend
    by forcing the wayland backend when GTK+ uses the Wayland backend.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=752143

 src/totem-object.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index d04d93b..8f540bf 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -68,6 +68,10 @@
 #include "totem-mime-types.h"
 #include "totem-uri-schemes.h"
 
+#ifdef GDK_WINDOWING_WAYLAND
+#include <gdk/gdkwayland.h>
+#endif /* GDK_WINDOWING_WAYLAND */
+
 #define REWIND_OR_PREVIOUS 4000
 
 #define SEEK_FORWARD_SHORT_OFFSET 15
@@ -501,6 +505,22 @@ totem_object_init (TotemObject *totem)
 {
        GtkSettings *gtk_settings;
 
+       gtk_init (NULL, NULL);
+
+#ifdef GDK_WINDOWING_WAYLAND
+       /* Work-around lack of sub-surface support in Clutter's
+        * GDK backend:
+        * https://bugzilla.gnome.org/show_bug.cgi?id=752143
+        * Also remove the include when that's fixed */
+       {
+               GdkDisplay *display;
+
+               display = gdk_display_get_default ();
+               if (GDK_IS_WAYLAND_DISPLAY (display))
+                       g_setenv ("CLUTTER_BACKEND", "wayland", TRUE);
+       }
+#endif
+
        if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
                g_warning ("gtk-clutter failed to initialise, expect problems from here on.");
 


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