Support (QtWayland 6.6) Compositor Handoffs
Description
With Qt 6.6 application running on KWin Wayland, it's now possible to keep the application alive after compositor crashes:
- https://blog.davidedmundson.co.uk/blog/qt6_wayland_robustness/
- https://invent.kde.org/plasma/kwin/-/wikis/Restarting
However, waypipe doesn't work with it, and when compositor crashes, waypipe exits and the remote Qt 6.6 application also exits.
Steps to reproduce:
This is trivially reproducible by using KDE Plasma Wayland on local PC and Qt 6.6 application on remote PC.
Prepare the session
- (Local machine) start waypipe client:
waypipe -s /tmp/waypipe-socket-local client
- (Local machine) start SSH socket forwarding:
ssh -R /tmp/waypipe-socket-remote:/tmp/waypipe-socket-local -t <remote-pc>
Execute the command in a tmux session to prevent compositor crashing from bringing SSH connection down.
- (Remote machine) start any Qt 6.6 application using waypipe:
export QT_WAYLAND_RECONNECT=1
waypipe \
--control /tmp/waypipe-ctrl \
--display wayland-waypipe \
-s /tmp/waypipe-socket-remote \
server -- <Application Path>
The environment variable QT_WAYLAND_RECONNECT=1
is required. KDE Plasma 6 sets this automatically but not for remote applications.
Strawberry is a Qt 6 application that supports reconnecting.
Test
A) Drop the SSH connection and reconnect:
- (Local machine) Press Ctrl + C on the SSH socket forwarding connection twice. Then connect again:
ssh -R /tmp/waypipe-socket-remote:/tmp/waypipe-socket-local -t <remote-pc>
- (Remote machine) Clean up the dead socket
unlink /tmp/waypipe-socket-remote
- (Local machine) Establish the SSH socket forwarding connection again:
ssh -R /tmp/waypipe-socket-remote:/tmp/waypipe-socket-local -t <remote-pc>
- (Remote machine) Finally, issue the reconnect command
waypipe recon /tmp/waypipe-ctrl /tmp/waypipe-socket-remote
B) Manually kill the compositor
Open System Monitor, find kwin_wayland and send signal SIGKILL
.
Expected results
For Test A: After issuing the reconnect command, the remote Qt application should reappear on local desktop.
For Test B: After compositor is restarted, the remote Qt application should reappear automatically.
Actual results
For Test A: After issuing the reconnect command, the remote Qt application seems to be aware that wayland socket is down, and console output Waiting for reconnection
. However, it never actually reconnect.
For Test B: After compositor is restarted, the remote Qt application is already killed.
Additional informations
The remote Qt application can reconnect properly after compositor restart if the local wayland socket is directly bind-mounted to the remote system (The remote system runs within a Incus container. Setup guide), without the use of waypipe.
David Edmundson (KDE maintainer) implemented most of the Wayland compositor hand-offs features. Here are some related links which might be useful: