GNOME Bugzilla – Bug 752143
1.23.2: totem has two windows if CLUTTER_BACKEND=wayland is NOT set
Last modified: 2016-03-17 14:38:19 UTC
I'm trying out Wayland under Mageia. There could be packaging problems! I'm using mutter/gnome-shell 3.17.3 and using the native backend of gnome-shell. Unless I set the following, totem crashes in clutter. I tried 1.23.2 as well as 1.22.4. Totem works fine after I do: export CLUTTER_BACKEND=wayland totem $FILE Clutter is compiled with egl,wayland backend+compositor,evdev (+lots of others). Backtrace: (gdb) bt
+ Trace 235244
Created attachment 307139 [details] [review] gdk: Use X11 API only when running under X11 Avoid using GdkX11Screen API when the GDK backend being used is not the X11 one.
Could you try with this patch on top of master or on top of clutter-1.22.4?
Quick, thanks! I tried it on top of 1.23.2. It doesn't crash anymore! :-D There's a new issue though. The video appears in a new window. It doesn't happen with export CLUTTER_BACKEND=wayland. I can open a new bug maybe?
(In reply to Olav Vitters from comment #3) > Quick, thanks! > > I tried it on top of 1.23.2. It doesn't crash anymore! :-D Pushed to master. > There's a new issue though. The video appears in a new window. It doesn't > happen with export CLUTTER_BACKEND=wayland. I can open a new bug maybe? If the video is appearing in a separate window it means that embedding Clutter inside GTK is not working, or the sub-surfaces are not working correctly. This usually means a bug in Clutter-GTK.
Re-assigning.
separate window is still happening with clutter 1.23.6 and clutter-gtk 1.6.2
Setting CLUTTER_BACKEND=wayland makes the separate window disappear, but video playback is still not working at all. I sometimes get audio, so I assume that gstreamer more or less works, and it is just the display part thats broken.
This seems to indicate something broken in the GDK/Clutter-GTK sub-surface handling. I assume that the sub-surface handling does not work properly under Wayland with the GDK backend. As to why the video playback does not work with the Wayland backend, your guess is as good as mine.
Yep; looking at the GDK API, there's no function to set the Wayland surface of a GdkWindow, so GDK and Clutter do not know that they should be drawing to the same surface. Totem could check if the GDK backend is the Wayland one, and force Clutter to use the Wayland backend — which would make things "work" (as soon as we understand why video playback does not work).
Playback works fine after hacking in a CLUTTER_BACKEND=wayland if the display is Wayland, but I don't get any input events from clutter-gtk/clutter-gst.
I've worked-around the extra window in totem, and playback works, but I can't get mouse events to propagate. We should probably move those hacks into clutter-gtk and clutter-gst though. 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
*** Bug 745722 has been marked as a duplicate of this bug. ***
This problem still exists in Fedora 22. Downgrading clutter to 1.22.2 and clutter-gtk to 1.6.0 as described in https://bugzilla.redhat.com/show_bug.cgi?id=1244474 resolves the problem.
This works correctly in Fedora 23. Wayland support is a moving target, make sure to use the latest version of the distribution, because I won't be supporting Wayland on F22 for totem.