After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752143 - 1.23.2: totem has two windows if CLUTTER_BACKEND=wayland is NOT set
1.23.2: totem has two windows if CLUTTER_BACKEND=wayland is NOT set
Status: RESOLVED FIXED
Product: clutter-gtk
Classification: Platform
Component: GtkClutterEmbed
1.6.x
Other All
: Normal normal
: ---
Assigned To: clutter-gtk maintainer(s)
clutter-gtk maintainer(s)
: 745722 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-07-08 21:30 UTC by Olav Vitters
Modified: 2016-03-17 14:38 UTC
See Also:
GNOME target: 3.18
GNOME version: 3.15/3.16


Attachments
gdk: Use X11 API only when running under X11 (1.25 KB, patch)
2015-07-09 13:35 UTC, Emmanuele Bassi (:ebassi)
none Details | Review

Description Olav Vitters 2015-07-08 21:30:50 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
  • #0 0x0000000000000000 in
  • #1 clutter_gdk_get_visual
    at gdk/clutter-backend-gdk.c line 538
  • #2 gtk_clutter_embed_realize
  • #3 bacon_video_widget_realize
    at bacon-video-widget.c line 629
  • #7 <emit signal ??? on instance 0xb84370 [BaconVideoWidget]>
    at gsignal.c line 3393
  • #8 gtk_widget_realize
    at gtkwidget.c line 5551
  • #9 video_widget_create
    at totem-object.c line 4081
  • #10 totem_object_app_activate
    at totem-object.c line 199
  • #11 _g_closure_invoke_va
    at gclosure.c line 864
  • #12 g_signal_emit_valist
    at gsignal.c line 3246
  • #13 g_signal_emit
    at gsignal.c line 3393
  • #14 g_application_activate
    at gapplication.c line 2114
  • #15 remote_command_cb
    at totem-menu.c line 281
  • #19 <emit signal ??? on instance 0x8904a0 [GSimpleAction]>
    at gsignal.c line 3393
  • #20 g_simple_action_activate
    at gsimpleaction.c line 225
  • #21 g_action_activate
    at gaction.c line 397
  • #22 totem_object_app_handle_local_options
    at totem-object.c line 279
  • #23 ffi_call_unix64
    at ../src/x86/unix64.S line 76
  • #24 ffi_call
    at ../src/x86/ffi64.c line 525
  • #25 g_cclosure_marshal_generic_va
    at gclosure.c line 1594
  • #26 _g_closure_invoke_va
    at gclosure.c line 864
  • #27 g_signal_emit_valist
    at gsignal.c line 3246
  • #28 g_signal_emit
    at gsignal.c line 3393
  • #29 g_application_real_local_command_line
    at gapplication.c line 975
  • #30 g_application_run
    at gapplication.c line 2280
  • #31 main
    at totem.c line 83

Comment 1 Emmanuele Bassi (:ebassi) 2015-07-09 13:35:29 UTC
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.
Comment 2 Emmanuele Bassi (:ebassi) 2015-07-09 13:40:16 UTC
Could you try with this patch on top of master or on top of clutter-1.22.4?
Comment 3 Olav Vitters 2015-07-09 16:39:30 UTC
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?
Comment 4 Emmanuele Bassi (:ebassi) 2015-07-11 12:28:40 UTC
(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.
Comment 5 Emmanuele Bassi (:ebassi) 2015-07-11 12:29:55 UTC
Re-assigning.
Comment 6 Matthias Clasen 2015-08-22 14:51:14 UTC
separate window is still happening with clutter 1.23.6 and clutter-gtk 1.6.2
Comment 7 Matthias Clasen 2015-08-22 14:55:49 UTC
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.
Comment 8 Emmanuele Bassi (:ebassi) 2015-08-23 22:07:12 UTC
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.
Comment 9 Emmanuele Bassi (:ebassi) 2015-08-23 22:17:35 UTC
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).
Comment 10 Bastien Nocera 2015-08-24 14:46:33 UTC
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.
Comment 11 Bastien Nocera 2015-08-24 16:22:42 UTC
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
Comment 12 Bastien Nocera 2015-08-25 12:48:30 UTC
*** Bug 745722 has been marked as a duplicate of this bug. ***
Comment 13 Bram Mertens 2016-03-14 19:58:36 UTC
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.
Comment 14 Bastien Nocera 2016-03-17 14:38:19 UTC
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.