-
-
Notifications
You must be signed in to change notification settings - Fork 898
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
compositor: implement wayland socket handover #6930
Conversation
94d994c
to
4a7c56e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm
ff41cf2
to
8a396b8
Compare
rebased onto latest main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
oopsie, someone didn't run clang-format :P |
Ahh sorry, should be correct now. |
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
c2a4871
to
2a6ba05
Compare
also, cleaned up the history. |
Note: Labwc has voiced some concerns on standardizing on these particular CLI options for socket handover. I created a discussion issue for figuring out a mechanism for socket handover that more compositors can agree on in this wl-restart issue. These CLI options will continue to be supported by wl-restart (likely indefinitely), and will continue to be the default for the time being. Alternative socket handover mechanisms could possibly bring support for Systemd socket activation for Wayland compositors in the future. |
Describe your PR, what does it fix/add?
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:
Hyprland 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, Hyprland will use these instead of finding a free Wayland display socket name and creating it.Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
This allows for Hyprland 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 Hyprland and perform all the same steps as a fresh Wayland client would. No additional handling is required on the side of Hyprland.
The helper tool finds and creates the Wayland socket and launches Hyprland 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:
kwin_wayland_wrapper
(only for KDE)wl-restart
(developed by me)Is it ready for merging, or does it need work?
This PR works well from my personal testing.