We no longer need --exit-with-session as plasma_shutdown explicitly
quits kwin gracefully.
We also don't want to relaunch ksplash if kwin restarts.
We run the whole script as we need to restart ksmserver as xserver will
be restarted.
For other services, if they get restored through crash handlers or this
doesn't really matter. DBus unique-ness will take care of it.
Allowing users to manually change the font DPI independent of font sizes
and the global scale is already of questionable value on X11, but on
Wayland where Qt scaling is always used, it is an anachronism. So let's
only show it on X11. On Wayland, people can use the global scaling
feature in the KScreen KCM.
See also https://phabricator.kde.org/T9500
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.
closeSession returns only when the task is complete, a sound API, but we
need to remember to increase the timeout.
If a user has unsaved changes in kate, they could handle that prompt
after an indefinite period of time. We would still want to shutdown
afterwards.
Currently plasma-shutdown would abort if it thought ksmserver timed out.
Not seen in real life, just spotted in code review.
On X Kwin's lifespan used to be managed by XSMP. This accidentally broke
in 5.20 as we made kwin start before ksmserver for speed purposes and
wayland preparation.
This leaves kwin to be killed by the display manager as the X connection
closes, but this can lead to deadlocks.
BUG:428817
On wayland kwin's lifespan is mapped to the lifespan of the ksmserver
binary. This is problematic as it makes our entire xwayland robustness
redundant if we ultimately rely on an application that /has/ to run in
xwayland.
We do this sometimes, but not consistenly.
The benefit is twofold.
First it improves the diff when adding new values since no existing line needs to be touched.
Second it prevents clang-format from collapsing the definition into a single line, which is undesired for large enums.
We want to last until all jobs are finished and the notification sound
thread has finished. The design intention was to let QEventLoopLocker
handle all of it implicitly, but that doesn't work when we call quit
explicitly.
BUG: 422948
Systemd passes the condition as `--condition <cond>`, not as a positional argument.
Also switch around return codes, 255 is special-cased to mean that the unit has failed.
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.
This means on logout we'll be gracefully closed down.
All of these are closing down properly anyway, but this makes things a
bit more explicit in case you managed to log out at an awkward point.
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
startplamsa-wayland and startplasma-waylandsession are split so that
anything requiring an X or wayland connection happens in
startplasma-waylandsession anything else can happen in the first binary.
runStartupConfig and setting an env variable can happen before kwin. It
might even fix a bug if kwin used any calls that rely on QLocale.
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
Typically on modern systems this will be started for us earlier in the
startup series and we don't have to worry about it.
For X11 clients look for the bus address on the X11 root window as a way
of sharing.
For reasons at the time we start our own DBus session within our wayland
session. Nesting causes conflicts and problems so this patch only start
a dbus session if one has not been set up already.
BUG: 404335
The initial comment about disabling quitLock is deprecated since we
added a QCoreApplication around the startup.
We can then use Qt's mechanism to delay application exit till the
notification thread finishes.
This presumably has been a bug for a while, but noticable in 5.19 after
even more startup performance improvements.
BUG: 422948
(cherry picked from commit ef4b84869612318ecb3cec44bd6c713ad545114f)
Startplasma monitors ksmserver and tears down the session if it goes
away, to match previous behaviour and as some lockscreen bypass
protection.
When we teardown our new binary plasma-shutdown appears, runs scripts
and makes the final shutdown call. ksmserver could gracefully quit in
the meantime, so startplasma guarded this case and waited till both
names exited. However it contains a really stupid typo.
BUG: 422870
Summary:
For systemd autostart generator will add a ExecCondition=kde-systemd-start-condition rcfile:section:entry:default
As described in T12627. Needs D28421
Test Plan:
Run kde-systemd-start-condition; should return 0 with a missing or incomplete argument, 255 with a false or non-existent and non-default con
fig value.
Reviewers: davidedmundson, broulik, dfaure, ngraham, meven
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28424
Summary:
Sort environment scripts before they are sourced. User scripts should run after system scripts to ensure that user preferences take precendence over system defaults. Scripts in each location (user and system) are then separately sorted in lexical order to ensure deterministic source order.
BUG: 420085
FIXED-IN: 5.19.0
Reviewers: #plasma, davidedmundson, apol
Reviewed By: apol
Subscribers: cfeck, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28941
Summary:
plasma-session goes to great lengths to make sure we have the latest env
vars from kcminit in future spawned jobs.
However one part got broke in some refactor, we capture the system
environment when we make the job, not when we're about to launch.
This means potentially kded5 and ksmserver wouldn't have the envs
kcminit set.
I've not noticed any practical impact from this.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28626
Summary:
It was safeguarded by an environment variable so we don't retroactively
change behaviour of existing setups in a bugfix update.
See https://phabricator.kde.org/D27883
Test Plan: Compiles
Reviewers: #plasma, apol
Reviewed By: apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28300
Summary:
This was a deliberate decision to remove this in
c673a83226
The logic being that kdeinit should auto launch itself if required.
In practice this exposes a presumably pre-existing bug in kdeinit
autostarting where the env is not set correctly.
Test Plan:
qdbus org.kde.klauncher5 /KLauncher org.kde.KLauncher.exec_blind /opt/kde5/bin/kate ""
kate opened
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D27868