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
Summary:
This reduces a bunch of code, both hidden in the backend as well as the
mostly duplicated front end UI, making it more consistent for users too.
There is a behavioural change that switching user then cancelling will
require your own password.
KSMServer still has the same DBus slot for compatibility which then
proxies over to the screensaver. This could be calling itself, it might
be calling kwin when we're on wayland.
Depends on D15186
Test Plan:
Pressed switch user from the UI
Got a swich user dialog
Reviewers: #plasma, mart
Reviewed By: #plasma, mart
Subscribers: ngraham, mart, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15187
KDisplayManager::bootOptions only worked with "NewKDM" but KDM is obsolete in Plasma 5.
Creating an instance of KDisplayManager does DBus stuff to find out the DM being used.
Also, kdmrc is dead and this code always returned None anyway.
Differential Revision: https://phabricator.kde.org/D13998
Summary:
Gives a speed boost on multiple monitors where we have multiple views.
Also cleaned up some imports/paths used
Test Plan:
Grepped use of rootContext() referred to the right context
Used greeter to log out successfully
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D12891
Since Phonon 4.9, this code fails to play a login sound if the sound
file is specified as absolute file path (without "file://"). The reason
is that QUrl() treats the parameter as Url (not as file path), and this
only accidentally worked with earlier Phonon versions but not any more.
This patch uses QUrl::fromUserInput() instead to create a QUrl from the
string in the settings file, which fixes the problem.
This is the same change as
https://phabricator.kde.org/R289:9db06adc8114163f401417064b07772139bc36bc
in knotifications.
A more detailed explanation of the problem can be found in
https://bugs.kde.org/show_bug.cgi?id=337276#c12 .
BUG: 392725
FIXED-IN: 5.12.5
Differential Revision: https://phabricator.kde.org/D12606
Summary:
The TERM signal handling in ksmserver invokes functions which are not async-signal safe, like Qt functions and C++ destructors. Moreover, the signal handling can occur in other than the main thread, which leads to Qt complaining about functions being invoked from the wrong thread. Such a crash can be seen in a report of [[ bug 384316 |https://bugs.kde.org/show_bug.cgi?id=384316 ]].
To fix both of these issues, this change makes the signal handling use the self-pipe trick, which signals the need for termination to the main thread by writing to a special-purpose file descriptor. The main loop then takes care of the termination. This is mostly inspired by [[ http://doc.qt.io/qt-5/unix-signals.html ]].
Note that `QApplication::quit` already does what we need when destroying the server, particularly deleting `the_server`/calling `cleanUp()`.
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: broulik, graesslin, davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D8673
Summary:
This is a preparation step to unset QT_QPA_PLATFORM from the wayland
startup session script. Setting QT_QPA_PLATFORM breaks 3rd-party Qt
software which does not bundle QtWayland. Most prominent example is
the Qt installer itself (see
https://bugreports.qt.io/browse/QTBUG-60222).
On the other hand our Plasma workspace applications need to be forced to
Wayland on a Wayland system. So we have a conflict between we want to
set QT_QPA_PLATFORM and we don't want to set QT_QPA_PLATFORM.
This change adds new API to KWorkspace to address this problem. The new
method adjusts the QT_QPA_PLATFORM based on the XDG_SESSION_TYPE
enviornment variable. It is completely opt-in. Meaning applications need
to explicitly add the call prior to creating the QGuiApplication and if
the user specifies either QT_QPA_PLATFORM env variable or any of the
-platform command line argument variants, the platform detection is
skipped.
The change also adjusts all plasma-workspace applications which should
use Wayland on Wayland to use the new API. The startup script on the
other hand still sets QT_QPA_PLATFORM. We also have applications outside
of plasma-workspace which needs this detection. Examples are:
* powerdevil
* systemsettings
* kinfocenter
Once this change is merged those applications can be adjusted by linking
against PW::KWorkspace and afterwards QT_QPA_PLATFORM can be unset from
startplasmacompositor.
Test Plan: See added autotest
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10816
Summary:
Clicking on a button makes Qt grab the pointer, which means the screen can't be
locked. As we wait for the screen to be locked before switching, this never
happens.
BUG: 391007
Test Plan:
Previously the userswitcher only worked on every second try, now it works
always on the first click.
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: ngraham, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10802
Summary:
The logout dialog has a taskbar entry and appears like a regular window on
wayland. This is because Qt does not support fullscreen windows with xdg_shell
as of 5.9.4. wl-shell works, so force it for the time being.
Test Plan: Ran ksmserver-logout-greeter on X11 and wayland, looks identical now.
Reviewers: #plasma, graesslin, davidedmundson, bshah
Reviewed By: #plasma, graesslin, bshah
Subscribers: ngraham, bshah, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10425
Summary:
The logout dialog has a taskbar entry and appears like a regular window on
wayland. This is because Qt does not support fullscreen windows with xdg_shell
as of 5.9.4. wl-shell works, so force it for the time being.
Test Plan: Ran ksmserver-logout-greeter on X11 and wayland, looks identical now.
Reviewers: #plasma, graesslin, davidedmundson, bshah
Reviewed By: #plasma, graesslin, bshah
Subscribers: ngraham, bshah, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10425
Summary: port the shutdown dialog to package::fileUrl, dropping the support for old custom themes
Test Plan: shutdown dialog work correctly both with normal and rcc kpackages
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D9195
Summary:
It's an overly slow call and it gets in the way on a process that needs
to be responsive
Test Plan: Still boots
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D9090