"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
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:
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:
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:
Currently startplasma spawns plasma-session then sits around waiting for
that to finish
plasma-session spawns all the startup then also just sits around doing
nothing
This patch makes plasma-session spawn all the startup and then quit.
It also splits the owner of the org.kde.shutdown interface to be on
demand. plasma-shutdown asks ksmserver to quit and then if applicable
runs the shutdown scripts or not.
Startplasma then knows when to exit by monitoring the DBus service
status directly.
The benefits are that we save some resources by not needing
plasma-session lingering about.
It also means the shutdown interface is re-usable as-is when the pending
systemd startup method is used.
Test Plan:
Logged in and:
- ran killall ksmserver, session ended as before
- logged out and cancelled due to unsaved changes
- logged out and completed logout
- logged out and rebooted
Reviewers: #plasma, apol
Reviewed By: apol
Subscribers: apol, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D27629
Summary:
Since ksmserver was split, start-plasma launches plasma-session which in
turn invokes ksmserver.
Test Plan: No code changes, only a method rename
Reviewers: #plasma, broulik, apol
Reviewed By: #plasma, broulik, apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D27621
Summary:
Applications which set `Qt::AA_EnableHighDpiScaling` use the DPI of the monitor the window is on to calculate an additional scaling factor.
Plasma sets `QT_SCREEN_SCALE_FACTORS` in the environment for manual specification of per-monitor scale, which combined with the automatic scaling may result in double scaling.
To disable the automatic scaling, `QT_AUTO_SCREEN_SCALE_FACTOR=0` has to be set, even on Qt 5.14.
As a side effect, this works around QTBUG-80967 as well.
BUG: 415421
Test Plan: On X11, with a >144dpi monitor and a scaling factor of 2 set manually, scaling was doubled previously. Now it works as expected.
Reviewers: #plasma, apol, davidedmundson, fvogt
Reviewed By: #plasma, davidedmundson, fvogt
Subscribers: acooligan, fvogt, asturmlechner, dfaure, davidedmundson, anthonyfieroni, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D26185
Summary:
For normal distros it doesn't make sense, KDE_INSTALL_FULL_DATAROOTDIR
will be /usr/.
For devs using a prefix startplasma-dev.sh already does this for us only
for the dev setup.
For any other user, it should be their responsibility to adjust it.
It's currently broken anyway, if a user simply installs flatpak that sets this env
earlier in the boot, so this will do nothing. It implies no-oe relies on thisl
It's a relic from 2007 (bd38d59e11548f160efd0918ca5461536ac72349) that doesn't
make sense now.
BUG: 315452
Test Plan: Compiles
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D26537
Summary:
Use '\0' as separator as '\n' is likely to appear in values.
BUG: 413130
Test Plan:
/etc/profile.d/mc.sh exported an mc() function,
which resulted in "syntax error: unexpected end of file" in the Plasma session.
Now the mc function is correctly set in the environment.
Reviewers: #plasma, apol, davidedmundson, adridg
Reviewed By: #plasma, apol, davidedmundson, adridg
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24750
Summary:
It gives the following runtime warning:
Warning: QT_AUTO_SCREEN_SCALE_FACTOR is deprecated. Instead use:
QT_ENABLE_HIGHDPI_SCALING to enable platform plugin controlled per-screen factors
But we don't need to set QT_ENABLE_HIGHDPI_SCALING to 0.
Just setting QT_SCREEN_SCALE_FACTORS is enough to control scaling, after
my commit e018d11600bffc6 to qtbase.
Kudos for porting startkde to be C++ code, it makes this commit much
easier...
Test Plan: Builds; not rebooted yet
Reviewers: apol, davidedmundson
Reviewed By: davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24255
Summary: It got lost during the porting to native executables
Test Plan:
Set KDEWM=awesome, successfully started a new Plasma
session with it, unset it again and kwin is started in the next
session.
Reviewers: #plasma, apol, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D23910
This allows new startup procedures to use a session manager and also
allows us to slowly replace the session manager without breaking plasma.
Following on from the previous refactor, Startup and Shutdown are moved
from kmserver and the previous calls into KSMserver are replaced with
DBus calls.
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D21995
Summary:
Fixes regression from the startkde C++ re-write which made ksmserver
start the kscreenlocker in wayland session, resulting in the double
lockscreeens.
Test Plan: after applying patch I only get one lockscreen
Reviewers: apol
Reviewed By: apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22021
Summary:
At the moment we had several scripts to start the different processes. With this we unify this code into an application that takes care of the whole process.
This allows us to:
- Save on process spawning, we don't need to run a separate process synchronously for every single thing.
- Don't have a redundant configuration file parser but reuse the one we've already optimised in KConfig.
- Issue dbus calls from the process itself instead of spawning qdbus.
- Removes a bunch of duplicated code.
Test Plan: Started different systems on different distros, on wayland and x11.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D21725