summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2015-08-24 16:56:36 +0200
committerBastien Nocera <hadess@hadess.net>2015-08-24 17:04:18 +0200
commit6051dd76ac5e1738e00cbb677aeadea32e3df3be (patch)
treedb54d8a812b2da3bc50cca445e55a9bed198419a
parent4c708c64002289881c9aa9376a9831a9a99fc869 (diff)
downloadtotem-6051dd76ac5e1738e00cbb677aeadea32e3df3be.tar.gz
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
-rw-r--r--src/totem-object.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/totem-object.c b/src/totem-object.c
index d04d93bf2..8f540bf52 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.");