QProcess::start defaults to capturing all output, but that got lost as it is
never read. Set QProcess::ForwardedChannels explicitly where it was missing,
so that output ends up in the correct place again.
There's no use of static declarations in headers, those result in compiler
warnings. They could be removed envirely after moving one function up a bit.
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
This has been opt-in for several releases and on by default in one major
distro. Minor issues were found, but they have all been resolved.
There are still checks that the user has systemd available and with a
version new enough for autostart.
KSplash is changed to read which theme to use directly. It's already
linking config and it already loads the default shared config implicitly
so we weren't saving anything having it done by the launcher.
On X11 ksplash is still managed by startplasma-x11 as we can do it
straight away.
For wayland we need to wait till kwin is up so this is done either by
plasma-session or systemd. For systemd the unit is started explicitly so
we can parse the config file, but after the target starting kwin is
started so that the "After=" line works correctly.
ksmserver can crash if xwayland goes down, which currently happens
should kwin restart. With the refactoring this means kwin_wayland
restart handling would regress.
Instead we can tie to kwin wrapper on wayland. This closes after a
graceful shutdown as that instructs kwin to quit.
with this, if the configured color scheme was changed, or if the color scheme
file was updated, the colors will be reapplied and the plasma svg cache discarded
save on config the hash of the current color scheme file
the normal defaults cascading mechanism for application colors doesn't work, as header colors would be wrong, so check if colors are missing from kdeglobals and in that case apply the colors from lnf to kdeglobals
Changes how plasma_session works. Instead of just starting the
processes, plays the startup sound and stays around. This process then
gets to be terminated as the session ends.
BUG: 359651
BUG: 433293
Systemd units which are symlinked to the service directory will be in
`linked` or `linked-runtime` state. They are also available and
runnable. This can happen when the package manager uses symlinks to
install systemd units instead of copying them, like on NixOS.
StartPlasma's fontDPI syncs the current font DPI to xrdb, which affects
font DPI for X applications (inc apps run in xwayland)
This is seldom used on wayland as with framebuffer scaling you don't
want to adjust your font DPI, but it is used by some users. As it's
xrdb, it needs to come after Xwayland is started for the wayland case.
The goal of this patch is to move towards killing the
startplasma-waylandsession binary as well as just being better design to
have these things comparmentalised.
kcminit is very early in the boot process before all GUI apps with the
exception of ksplash. I don't think this will make a big difference as
that's just a picture anyway?
From what I can tell these aren't used by anybody, and not something we
want to be using whilst we increase our wayland support.
Grepping through all of KDE, the only usage I found was kde 4's
KApplication and that code is exclusively checking for
"KDE_SESSION_VERSION==4" which will be false anyway.
The version in kdelibs4support checks for the env variable too.
- Remove check for kded and confupdate stages in SplashApp, those setStage()
calls were removed a long time ago[1]
- Rename 'kinit' stage to 'startPlasma', since it's called from startplasma
- Remove startKDEInit(), it was declared but not defined anywhere, most
likely left-over from a previous refactor.
https://phabricator.kde.org/R297:185afa8a3af8002172d8f5d6aa08c57244422a12
"If $XDG_CONFIG_DIRS is either not set or empty, a value equal to
/etc/xdg should be used."
If XDG_CONFIG_DIRS was not set prior to startplasma, which it ordinarily
would not be, then the previous code would set the value to "$newdir:"
which was silly and also wrong as per the spec quoted above. Instead
default to /etc/xdg/.
Also camelCase the variables to follow our coding style.
This commit changes what counts as the default settings to take into account the default
settings of the current Global Theme.
e.g. if you change the Global Theme to Breeze Dark, when you go to the color KCM, clicking
the "Defaults" button will revert to the Breeze Dark color scheme (because it is the default
color scheme of the active Global Theme), rather than Breeze Light.
If a service has recently failed multiple times, systemd will (quite
cleverly) not restart it. This includes DBus activation so is indepdent
of the systemd boot.
If a service gets into a broken state on a previous session where ithas
different environment variables and a different display server, we
shouldn't treat it as failed for a new session.
This shouldn't be needed with the other recent fixes, but it seems like
a good practice nevertheless.
Gnome are doing something similar:
https://gitlab.gnome.org/GNOME/gnome-session/-/blob/master/gnome-session/main.c#L565
ListUnitByNames did not quite work as the author (me) expected. Whilst a
search for "adsfasf" yeilded an empty list a well-formed name like
"asdfasdf.service" would return a result to say that service was not
loaded.
This means our runtime detection of xdg-autostart-generator failed.
By using ListUnitFilesByPatterns we can filter on the status in the
query, meaning this code works again. We also can query the case of it
being available but explicitly disabled.
BUG: 433333
This add fix to avoid session specific environement variable to be
leaked into new session.
Also, it will restore the old systemd session variable upon shutting
down.
systemd provides a desktop diagnostic place for user to set environment
variables. Currently we only export to it but didn't import from it.
This would also import from it so we are able to use environment.d to
set environment even systemd unit based plasma is not used.
xdg-desktop.target was the name at the time of first being written, but
it was renamed upstream.. I had both on my system from a previous
compilation.
plasma-workspace.target already "Wants" the correctly named one.
Noticed by Benjamin Berg
Summary:
This brings numerous advantages such as:
- easier admin configuration with drop-ins, overrides and multiple
hooks throughout (and only having to learn one tool)
- session cleanup on exit, avoiding that occasional part where shutdown
hangs
- startup that actually knows when things are up
- race free autostart and DBus activation at once
- logs that rotate are split by service and usable
- resource management through slices and cgroups (the part I want)
Over the past 2 years I've been trying to tidy up and encapsulate the
relevant parts of startup into the binary plasma-session so that we can
just runtime swap out that one part and supporting both paths will be
easy.
Support is toggleable via cmake flag, as it seems like it should be a
distro decision, especially as we will require a specific systemd with
the xdg-generator.
KDED/kwin/other services are attached to the relevant repo.
Task T11914
Differential Revision: https://phabricator.kde.org/D28305
squash
This existed to include the .kde directories in the search paths for
ghostscript, which clearly hasn't been the case for years, but the code
has kept getting ported and migrated.
At some point this has got broken, startplasma-x11 doesn't call this
path and we've not had any bug reports. We may as well clear this
legacy.
This reverts commit edc64d04a1.
This commit unfortunately caused a serious regression. Another approach
will be needed to solve 176650 and 417070.
BUG: 423995
FIXED-IN: 5.19.4
CCMAIL: alexander.lohnau@gmx.de
This reverts commit edc64d04a1.
This commit unfortunately caused a serious regression. Another approach
will be needed to solve 176650 and 417070.
BUG: 423995
FIXED-IN: 5.19.4
CCMAIL: alexander.lohnau@gmx.de