Freeze when trying to open in Sway on Wayland.
Issue
Trying to launch gnome-control-center
in Sway Wayland compositor hangs in a Wayland callback loop before showing any output or even responding to --help
argument. The loop starts after the program issues asks for keyboard settings with wl_seat@35.get_keyboard
which is sent after receiving last globals from wl_display@1.get_register
.
wl_callback@32.done(51759)
-> wl_display@1.sync(new id wl_callback@32)
wl_display@1.delete_id(32)
My usecase for wanting to use Gnome settings on Sway is to control and log in to Gnome Online Accounts to use GVFS Google Drive integration.
Behavior on Gnome
In Gnome after asking for keyboard and pointer from the wl_seat
the program proceeds to getting swipe and pinch gestures after which it attaches to the wl_surface
and starts opening the window.
Some immediate differences I see are:
-
gtk_shell1
andgtk_primary_selection_device_manager
globals are bound to in Gnome but not on Sway (not available on Sway) -
wl_drm
is never bound to on Sway but is bound to on Gnome.
Steps to reproduce
- Open a session of Sway and a session of Gnome (Wayland). In this case we have
wayland-0
be Gnome Wayland display andwayland-1
be Sway Wayland display. - Run
WAYLAND_DISPLAY=wayland-0 gnome-control-center
from a terminal on Sway. See that the window is properly launched to Gnome side. - Run
WAYLAND_DISPLAY=wayland-1 gnome-control-center
on Sway. The program hangs with no window being opened.
Attached are the logs of WAYLAND_DEBUG=1 gnome-control-center
and strace gnome-control-center
for WAYLAND_DISPLAY=wayland-0
, WAYLAND_DISPLAY=wayland-1
, --display=wayland-0
and --display=wayland-1
.
WAYLAND_DISPLAY=wayland-0 strace gnome-control-center 2>&1 | tee strace_WAYLAND_DISPLAY_gnome
WAYLAND_DISPLAY=wayland-1 strace gnome-control-center 2>&1 | tee strace_WAYLAND_DISPLAY_sway
strace gnome-control-center --display=wayland-0 2>&1 | tee strace_gnome_opt_display
strace gnome-control-center --display=wayland-1 2>&1 | tee strace_sway_opt_display
WAYLAND_DISPLAY=wayland-0 WAYLAND_DEBUG=1 gnome-control-center 2>&1 | tee wl_dbg_WAYLAND_DISPLAY_gnome
WAYLAND_DISPLAY=wayland-1 WAYLAND_DEBUG=1 gnome-control-center 2>&1 | tee wl_dbg_WAYLAND_DISPLAY_sway
WAYLAND_DEBUG=1 gnome-control-center --display=wayland-0 2>&1 | tee wl_dbg_gnome_opt_display
WAYLAND_DEBUG=1 gnome-control-center --display=wayland-1 2>&1 | tee wl_dbg_sway_opt_display
wl_dbg_sway_opt_display wl_dbg_gnome_opt_display wl_dbg_WAYLAND_DISPLAY_sway wl_dbg_WAYLAND_DISPLAY_gnome strace_sway_opt_display strace_gnome_opt_display strace_WAYLAND_DISPLAY_sway strace_WAYLAND_DISPLAY_gnome
The used versions of software
(All from Arch Linux repositories)
- Sway v1.7
- wlroots 0.15.1
- Gnome shell 41.4
- Gnome control center 41.4
Extra issues/findings found while debugging
- When launching
WAYLAND_DISPLAY=wayland-1 gnome-control-center
from Gnomestrace
output shows that onlywayland-0
file is tried to be opened and the window is opened to Gnome although byWAYLAND_DISPLAY
it should be opened to Sway side. However launching withgnome-control-center --display=wayland-0
the program hangs similarly to how it hangs when launching withWAYLAND_DISPLAY=wayland-1
on Sway. -
--help
option seems to require a working connection to Wayland compositor. The same applies to-l
. - In
--help
text--display
option says it's for X display but it seems to work fine for Wayland displays too. - This happens before for example
--help
text is printed or--debug
yields any logs. -
gnome-control-center --display=:0
yields error(gnome-control-center:263734): Gtk-WARNING **: 00:13:57.527: cannot open display: :0
and exits -
WAYLAND_DEBUG=1 GTK_BACKEND=x11 gnome-control-center
tries to use Wayland, not Xorg -
GTK_BACKEND=x11 GDK_BACKEND=x11 gnome-control-center
throws error(gnome-control-center:264062): Clutter-Gtk-ERROR **: 00:15:11.639: *** Unsupported backend.
and exits to a trace trap. -
CLUTTER_BACKEND=x11 GTK_BACKEND=x11 GDK_BACKEND=x11 gnome-control-center
works but window opens on Xorg. -
CLUTTER_BACKEND=x11 GTK_BACKEND=x11 gnome-control-center
crashes to trace trap with error(gnome-control-center:264271): Clutter-Gtk-ERROR **: 00:16:36.016: *** Unsupported backend.
-
CLUTTER_BACKEND=x11 GDK_BACKEND=x11 gnome-control-center
works fine and window opens on Xorg.