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
The connection to the lambda persists, so when it's called a second time,
the lambda is also called twice, eventually resulting in a nullptr deref as
m_restoreSessionCall is empty.
ksmserver starts in plasma-session. It currently sets the
SESSION_MANAGER env back to just kinit and plasma-session which is then
used for anything else that plasma-session starts.
This is after start-plasma has synced the environment to DBus/systemd.
By using the shared UpdateLaunchEnvJob we can sync all these places.
BUG: 425982
This is a patch carried by FreeBSD for a long time; I may have submitted it upstream before.
libICE is **not** in the standary library search paths on FreeBSD, so using the straight-up name *ICE* in `check_library_exists()` won't find it -- even though libICE has previously been found, probably by `find_package(X11)`
Use the full path, which is what `${X11_ICE_LIB}` should hold.
Rather than calling into KLauncher directly.
I think silently failing rather than using a modal potentially interrupting startup is acceptable here?
Differential Revision: https://phabricator.kde.org/D29226
Summary: "ksmserver" is not a good user visible string.
Test Plan: check in global shortcuts kcm
Reviewers: ngraham, #plasma, #vdg, davidedmundson
Reviewed By: ngraham, #plasma, #vdg, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D29058
Summary: As we don't launch with kinit, no point ksmserver linking against it
Test Plan: Compiles
Reviewers: #plasma, apol
Reviewed By: apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28676
Summary: Still included dcop, hadn't been compiled in years I presume.
Test Plan: All good and normal
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28385
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:
Kwin had to have two ICE connections in order to track state
indepdendently of it's session saving.
This replaces that with a more direct DBus protocol allowing for both
simplification on the kwin side as well as comunicating the logout state
better for effects.
Whilst this code temporarily complicates things, now we have this
interface the next step is drop all the isWM() stuff and do kwin
specific session management also over this interface. See T11882
Test Plan:
Added qdebug into kwin
started logging out with an unsaved file, cancelled shutdown
started logging out with, discarded file
Reviewers: #kwin, apol
Reviewed By: apol
Subscribers: broulik, apol, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24945
Summary: It may be used through KNotifications
Test Plan: Builds
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D25093
Summary:
At some point there was an effect in kwin to fade to a grey (with a
weird vigenette effect) as one logs out.
This was signalled with a fake offscreen window with a special window
ID.
The kwin effect has gone, deleted in Plasma 5.8 with
af80a546bfe258b54468b159bb8cf78f16ca9ebf
(Kwin still contains an effect called logout, but that's merely for the
logout prompt)
I intend to replace this logout effect but as I'm going to start from
scratch we may as well communicate from ksmserver -> kwin with a new API
that works on wayland and and solves some other issues all in one.
Test Plan: Compiles
Reviewers: #plasma, #kwin, apol
Reviewed By: apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24759
Summary: Include duplication, no newline at the end of file and missing argument to the i18n() call
Test Plan: Should work fine but needs a review for i18n() calls
Reviewers: #plasma, apol
Reviewed By: apol
Subscribers: apol, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24580
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:
The inhibition was dysfunctional, as powerdevil delays the inhibition
by 5 seconds (and is already stopped when the delay times out). Also
powerdevil handles concurrent user session shutdowns and sleep requests
itself, so the code is obsolete.
As KDELibs4Support pulled in a number of Frameworks, we have to
explicitly add these now.
Reviewers: #plasma, broulik, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: apol, sitter, anthonyfieroni, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22296
Summary:
ksmserver's loading of other window manager relies on files in
share/windowmanagers/$name.desktop with the Exec line of the window
manager.
This was something previously installed by plasma-desktop and removed in
2016. All this code path is now redundant as well as the wmChanged DBus
method used by the deleted KCM.
Setting KDEWM manually will still work as before.
Test Plan:
Logged in
Got kwin as before
Reviewers: #plasma, broulik, apol
Reviewed By: #plasma, broulik, apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D21758
Summary:
We don't support multi X screen anymore in the rest of plasma. Cleans up
a bit of code.
Having multiple monitors via xrandr will still work as before.
Test Plan: Compiles
Reviewers: #plasma, apol
Reviewed By: apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D21757
Summary:
KSMServer has two modes, the slightly ancient mode (XSMP), and the
really ancient legacy mode (XSM).
When startup was rewritten in 96a595f1b8
we accidentally dropped the call that invokes restore of the legacy
session as well as the normal mode.
BUG: 404318
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D19028
Summary:
In the ksmserver porting most code was moved to explicitly calling
logout or shutdown methods rather than a random enum.
A legacy code path remained for compatibility. This path is used by the
containmentactions, in the refactor handling of
KWorkspace::ShutdownTypeDefault was lost.
BUG: 403466
Fixed-in: 5.15.0
Test Plan:
Set different default modes
Logged out using containment actions
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: ngraham, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D18435
Summary:
We don't need to introspect at runtime as KDED installs the interface
XML file.
Oddly KDED's package is called KDED not KF5KDED, hence the separate
find_package, I don't know if that's a bug in frameworks or not.
Test Plan: Compiles
Reviewers: #plasma, romangg
Reviewed By: #plasma, romangg
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16628
Summary:
This commit splits ksmserver's xsession shutdown logic from performing
the actual shutdown and running shutdown scripts and implement proposed
org.kde.Shutdown interface.
Intended longer term target is to move this to a separate executable.
KSMServer's existing logout dbus method still exists for compatibility
forwarding to the new interface.
There are 2 minor behavioural changes.
The shutdownMode property (which doesn't seem to do anything and is not
exposed in our UI) is not kept.
If you shutdown /whilst/ starting up somehow, previously we delayed
showing the logout prompt, we now delay performing the actual logout.
Test Plan:
Logged out / shut down using the old API
Logged out / shut down using the new DBus API
Reviewers: #plasma, apol, romangg
Reviewed By: #plasma, apol, romangg
Subscribers: romangg, apol, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16277
Summary:
kcminit had a slot to start processing something and a signal to emit
when it's finished.
For DBus that's quite bad practice as it can leave you hanging in the
case of a kcminit crashing. It's better to use the return of the
original call to signal when something is done.
From ksmserver we can then just use DBus timeouts set on the interface
than a secondary timer.
We also remove a pointless blocking call to kcminit introspecting
everything, if kcminit is not running it will return with an error
immediately which is no slower than checking first if it's not running
and faster if it is.
Test Plan:
Logged in
Session logs showed kcminit ran
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: zzag, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16587
Summary:
The old code checked ksmserver->defaultSession in the Startup
constructor before ksmserver was set up by main.cpp
This refactor moves it to the job, so we'll be checking if we're
restoring or not after ksmserver has been set up by main.cpp as well as
making the initial code path a bit clearer.
Test Plan:
Logged in with session restore
Logged in with a default session
Reviewers: ahartmetz
Reviewed By: ahartmetz
Subscribers: ahartmetz, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16550
Summary:
The code is effectively 3 startup phases each of which has some parallel
methods that need to be complete before moving onto the next phase.
The old code had a tonne of methods all of which tracking what state
we're in and trying to start the next method in the chain handling
things out of order.
This simplifies everything into 3 composite kjobs. A lot more classes,
but each one tiny with the flow more readable.
Code should be effectively the same. The startup sound is moved ever so
slightly earlier to be when phase 2 starts rather than just after
kcminit2 finishes (midway through the old phase 2), but no significant
behavioural changes here.
Test Plan: Logged in with session restore and without
Reviewers: #plasma, apol
Reviewed By: apol
Subscribers: apol, broulik, anthonyfieroni, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16231
Summary:
Everything related to Plasma startup goes in Startup everything relating
to X session management stays in KSMServer. Restoring the window
manager currently stays inside ksmserver as it passes the session ID as
an argument and at various points checks if something the client is the
WM.
Relevant methods move to server.cpp to keep one class per cpp file.
KSMServer gains some signals as it can no longer call the startup methods
directly to continue the process.
This is part of a cleanup series in ksmserver. (The friend class will disappear
in the next commit)
Behaviour should remain identical.
Test Plan: Logged in on X
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16225
Summary:
Removing this is part of preparations for ksmserver to become just an X
session manager. See T9779.
Instead of ksmserver opening the greeter with a tonne of args and then
having a socket to watch for changes, the new mechanism is that we fire
and forget the prompt. Then the logout prompt calls back into ksmserver
with the request. Simplifies code greatly allows for moving.
KSMserver's shutdown DBus method remain on ksmserver for compatibility,
but ultimately spawning the prompt will move to libkworkspace and called
from the session directly.
QML API in the logout greeter remains mostly untouched.
Behavioural changes are minor:
There was a QML property "choose" exposed to the greeter if the default
shutdown option is set to None. Though we don't allow this in the KCM
and our default prompt doesn't use it.
We no longer block a user from saving a session whilst a logout prompt
is active.
Test Plan:
Logged out
Shutdown
Also ran with old ksmserver, still got a prompt
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16066
Summary:
Apparently wl-shell fullscreen is broken on Qt 5.12 now, but we don't need this
workaround anymore.
BUG: 399918
Test Plan:
Clicked on logout, got the greeter. Without this patch, the greeter
was not visible.
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16381
Summary:
ksmserver autostart had a system where processes, such as plasma, could
block the startup phase from moving on.
It is currently entirely unused.
It's very difficult to use properly, plasmashell has to block startup
before ksmserver moves on to phase 1. Racey at best.
I did hack it to work, and it does make a surprising positive
improvement to bootup. Worth exploring the idea properly, but implemented
better.
We should be able to get the same results by
blocking and waiting for the DBus name in the autostart desktop file to
become registered rather than having a ksmserver-specific solution.
Test Plan: Compiles, can still login
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16042
Summary:
In response to the question in the TODO being removed:
No. KDBusService does it later
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D16040
Summary:
kcheckrunning is only used by startkde, it shouldn't be in the ksmserver
folder.
No code or behavioural changes, just tidying.
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15202
Summary:
"Shutdown" is a noun ("The nuclear reactor is experiencing a shutdown!")
"Shut Down" is an imperative command with a verb ("Shut down the nuclear reactor!"), which is how everything else is phrased.
Test Plan:
- Login screen button now says "Shut Down"
- Searching for "shut down" in KRunner brings up the appropriate option ("shutdown" still works too)
- KRunner says, "Shut down the computer"
Reviewers: #vdg, #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15878
Summary:
KSmserver is currently very heavily tied to the shutdown prompt dialog.
On upgrades a user ends up in a situation where they have an old
ksmserver running but a newer shutdown dialog. This has caused issues
repeatedly in the past.
I want to make some changes to how the shutdown prompt is shown for
5.15. First step is making the old releases more robust.
Prompt looks ugly but a user will only see it at most once. Hopefully
never.
Test Plan:
rm'd the greeter
Got an ugly messagebox instead of nothing
Reviewers: #plasma, broulik, ngraham
Reviewed By: #plasma, broulik
Subscribers: ngraham, broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15869
Summary:
org.kde.screensaver.xml is only part of KScreenlocker starting with
version 5.13.80, also the installation directory is not exported in
earlier versions.
Depends on D15228
Test Plan:
Try to build with kscreenlocker 5.13.0
Try to build with kscreenlocker 5.13.80
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15229