Port to Wayland
Fixes: #196 (closed), #302 (closed) (tasklist icon size)
Helps: #107 (closed), #176 (external plugins on Wayland)
This is supposed to cause no change in behavior on X11, except for tasklist icon issues it fixes above. On Wayland, this makes the bulk of the port given the currently available protocols. Some details may still need to be worked out here or there.
As external plugins support is still experimental, a hidden setting was added to force all plugins to run as internal, i.e. in the same process as the panel. To create and enable it, run
xfconf-query -c xfce4-panel -p /force-all-internal -t bool -s true --create
Of course, now if a plugin crashes the panel will crash with it.
This requires Libxfce4windowing to build. See below for some additional hints, in particular the targeted Wayland compositors.
See the messages of commits titled "wayland: *" for details about porting this or that feature. The commit that precedes them allows to start the panel on Wayland without crashing. The preceding commits are prerequisites or preliminary refactoring, which may be cherry-picked to master along the way.
See also:
- https://wiki.xfce.org/releng/wayland_roadmap
- Wayland related threads initiated in July and continued in August on the mailing list: https://mail.xfce.org/pipermail/xfce4-dev/2022-July/date.html
- Wayland thread about Libxfwl (formerly used in !96 (closed), superseded by Libxfce4windowing): https://mail.xfce.org/pipermail/xfce4-dev/2022-September/033008.html
- Wayland thread about Libxfce4windowing: https://mail.xfce.org/pipermail/xfce4-dev/2022-September/033019.html
- Wayland thread about external plugins: https://mail.xfce.org/pipermail/xfce4-dev/2022-October/033092.html
Approximate to-do list:
-
layer-shell protocol: -
Ability to move the panel -
Set exclusive zones (X11 struts) -
Autohide adaptations (layer-shell part)
-
-
foreign-toplevel-management and ext-workspace protocols (replacement for Libwnck implemented in Libxfce4windowing) -
Autohide adaptations (foreign-toplevel-management part) -
Embedded plugins -
pager -
showdesktop -
systray -
tasklist -
windowmenu
-
-
-
Ability to run plugins as external (separate processes) -
Make all X11/Wayland-specific dependencies optional
Known regressions/disabled features on Wayland:
- Plugin dnd (still movable via the prefs dialog)
- WM check at startup
- Span monitors
- Fix for the right handle not accessible in case of plugins overflow (#227 (closed))
- Grab is lost when changing monitor by moving the panel in automatic mode
- No geometry for intellihide (only window maximization)
- No shade/unshade for showdesktop middle-click
- No miniature view for the pager
- No dnd tasklist -> pager
Testing
The two main compositors used for this work are Labwc and Wayfire. My preference is Labwc for its simplicity and development goals, but Wayfire seems to be a better reference implementation for the moment, at least on some points (not so sure since Labwc 0.6.0).
The real reference implementation of the Wlroots protocols is probably Sway, but it is a tiling compositor, on which moving the panel works very badly. I don't think we should target this compositor, and I don't think the panel works well on i3 either (see for example #308 (closed)).
Weston is also sometimes useful as a reference implementation of general Wayland protocols, although the panel's functionality there is very limited since it does not implement the Wlroots protocols at all. One can also assume that the panel should do the best it can on a compositor of this type, and at least not crash.
It seems very preferable or even necessary to start the compositor from a tty to make proper tests.
Minimum configurations used for the moment:
Labwc (version used >= 0.6.0, see this issue for a video demonstration and discussions):
- run by:
XKB_DEFAULT_LAYOUT=fr labwc
-
~/.config/labwc/rc.xml
:<?xml version="1.0"?> <labwc_config> <keyboard> <default /> <keybind key="W-return"><action name="Execute" command="gnome-terminal" /></keybind> </keyboard> </labwc_config>
Wayfire (version used >= 0.7.4):
- run by:
wayfire
-
~/.config/wayfire.ini
:[input] xkb_layout = fr kb_numlock_default_state = true [autostart] 0_environment = dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY XAUTHORITY [command] binding_terminal = <super> KEY_ENTER command_terminal = gnome-terminal