Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sway/server: Implement wayland socket handover #8259

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ferdi265
Copy link
Contributor

@Ferdi265 Ferdi265 commented Jul 19, 2024

This PR implements the compositor side of the Wayland socket handover protocol as described in the KDE Wiki. The CLI options are chosen so that they are compatible with Kwin (and Hyprland):

Sway now accepts the CLI options --socket NAME and --wayland-fd FD, which pass the name of the Wayland display socket and the Wayland display socket fd number respectively. If given, Sway will use these instead of finding a free Wayland display socket name and creating it.

This allows for Sway to be used with a helper tool that automatically restarts the compositor on crashes, and allowing clients to reconnect after the compositor restart and survive the crash. The reconnecting clients look like new clients to Sway and perform all the same steps as a fresh Wayland client would. No additional handling is required on the side of Sway.

The helper tool finds and creates the Wayland socket and launches Sway with the new CLI options, restarting it when it exits with a non-zero exit code. Two such helper tools currently exist as far as I know:

@Ferdi265
Copy link
Contributor Author

Update: Labwc is unsure whether the Kwin CLI options are the right path forward. Before merging this, we should consider alternative mechanisms before multiple compositors standardize on a subpar mechanism. See this wl-restart issue.

This commit implements the compositor side of the Wayland socket
handover protocol as described in the [KDE Wiki]. The CLI options are
chosen so that they are compatible with Kwin.

[KDE Wiki]: https://invent.kde.org/plasma/kwin/-/wikis/Restarting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant