xwayland on demand
XWayland on demand
The challenge
Getting Xwayland to launch on demand is easy. The challenge is making the rest of the ecosystem work.
Our current boot on plasma involves several daemons and processes that set up several things that future clients rely on.
The relevant codepaths I have found so far is:
- xrdb setting the fonts and potentially cursor
- xsettingsdaemon. Same as above, but randomly different
- xembedsniproxy
- ksmserver
Xwayland has part of a solution. We can create a socket for regular clients, and a socket for the special clients. Special clients can connect anytime, others have to wait until the window manager has claimed the selection.
But that still means kwin launching all these and know when they're actually up (or failed) in a way that's not at-odds with the systemd managed services and the X11 boot.
Action plan
(this is mostly copying gnome)
- make xwayland on demand. Add a read socket notifier, connect, easy peasy. This is rather useless as ksmserver will start us on boot anyway, but it won't do any harm to land early
- add "-initfd" argument and export this as a new environment variable
- make the processes above use the new env instead of DISPLAY
- introduce a new systemd target for the x11-needing utilities (plus some shitty fallback script?)
- make kwin call that and wait for it to be up
- make the x11 session go through this path on startup
- gtk settings / xsd needs to be split from kded somehow
- add "-terminate" flags onto xwayland
Edited by David Edmundson