It is important that we end plasma-core.target plasma-workspace.target
and graphical-session.target when we log out. graphical-session in turn
closes all other apps and daemons and prevents restarts.
Handling it in systemd gives the least racey option.
graphical-session used to be hanlded in the plasma-ksmserver service
file, but this was removed in 5.24 in a refactor where it caused issues
for Xwayland restarting.
This patch reintroduces the sentinel programs to close down our target,
which in turn take down the other targets. It also removes a complicated
use of templates that in hindsight didn't really solve anything.
BUG: 448492
Testing done:
- logout of wayland shows all targets as inactive, logging in
repeatedly works smoothly
- logout of X11 behaves the same.
- calling systemctl --user stop plasma-kwin_wayland.service closes the
session
- killing ksmserver on wayland does not close the session
- killing ksmserver on X does
Currently we have a whole daisy-chain of startplasmawayland-> kwin ->
startplasmawaylandsession -> launching the session.
This was needed as we needed environment variables which previously we
only knew after kwin started.
After some kwin refactoring this is no longer the case, and
kwin_wayland_wrapper will sync it's environment variables to the
appropriate startup environments.
This allows us to move starting kwin_wayland to be systemd managed,
brining resource control, alongside it's classic counterpart
plasma-session.
Plasma core is moved away from being a template. This makes it easier
for others to mark themselves as being after. A new readme is added to
explain the design.