Summary:
Currently ksmserver sends DBus calls to klauncher to autostart services.
This patch brings all autostarting into the ksmserver process, putting
all autostart code together, and improving Plasma/Frameworks separation
(change requested by David Faure) with the long term goal of removing
this from klauncher; with a longer term goal of maybe even killing
klauncher.
We don't get two things autostarting as without ksmserver sending the
signals, klauncher does nothing.
Autostart.cpp code is copied verbatim so there's no breakage.
Test Plan: Logged in, got plasma and krunner and so on.
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: mart, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2544
According to Git / SVN history research, it was last used by KDE in
KDE 1. It seems like other toolkits also stopped using it 10-20 years
ago. It should have little to no practical relevance anymore.
I've found some documentation of legacy XSM session management from
1992, and the first copyright year of the XSMP spec (what we're
currently using) is 1993.
Also, XSM was removed from GNOME's gnome-session in 2005, rationale
and short discussion here:
https://mail.gnome.org/archives/desktop-devel-list/
2005-July/msg00527.html
with the following objections:
- Firefox doesn't support XSMP (long fixed)
- CDE on Solaris doesn't support XSMP (oh well...)
- Motif applications don't support XSMP
On kde-core-devel and kwin, nobody cared too much.
Consider XSM "accidentally" broken now ;)
https://marc.info/?l=kde-core-devel&m=144857647812257https://marc.info/?l=kde-core-devel&m=144976915400658
There is a utility called xsmproxy which comes from X.org.
It talks legacy XSM to clients and XSMP to an XSMP compliant
session manager and can therefore maybe hopefully make session
management of dinosaur applicatons sort of work.
It seems like that one received its last major modification
in 2003.
There is also some XSM related code in KWin that I will remove next.
QProcess::startDetached doesn't work on shell scripts, presumably
because it tries to daemonize them.
Porting to QProcess seems to fix this. As KSMServer stays around forever
this shouldn't result in any behavioural change.
REVIEW: 124838
Commit f913e251fe removed this, due to a porting bug: both klauncher
(XDG autostart using .desktop files) and ksmserver (kde-specific scripts)
were ported to look at the same directory (~/.config/autostart),
leading to double autostart. The right fix, however, is to use
a different directory for scripts, I called it ~/.config/autostart-scripts.
BUG: 338242
REVIEW: 124534
With its current architecture, KNotification can cause crashes on logout
due to use of Q_GLOBAL_STATIC and threads and Phonon and cleanup by main
thread. So this replaces the KNotification-in-a-thread with Phonon
directly.
This is exactly what KNotification would do. This is for the time being
until the crash on logout is sorted out.
Additionally, this also fixes logout sound which was missing before.
This uses normal KNotification as at that point we don't need to be
threading or anything, so KNotification is just safe.
REVIEW: 123834
If ksmserver is started in a session with WAYLAND_DISPLAY
and/or WAYLAND_SOCKET being exported we can assume that the Xserver is an
Xwayland server. In that case the wayland compositor is also the window
maager. Thus starting a window manager would either fail or create severe
havoc in case it succeeds in replacing the running window manager.
REVIEW: 123444
KSMSERVER_STARTUP_DEBUGl is not defined, meaning this code currently
exists in our ksmserver.
if you have 2 instances of gedit, konqueror and kspaceduel open you get
an error message saying drat. I'm not sure why.
This feature is now obsoleted as kspaceduel doesn't exist any more.
REVIEW: 123283
If klauncher can't launch any of the services within the phase2
autoStart2Done will be never called, hence leaving ksmservice in an
invalid status.
Since at this moment is almost impossible for klauncher to make sure
that autoStart2Done is always called we have to add a work around the
same way we have done with all the other phases.
This workaround is specially useful since it is in phase2 where we
launch third party stuff.
Currently KLauncher is responsible for starting all of the autostart
files. It intelligently starts only the files which should be started in
the KDE environment.
Once this is done, KLauncher then decides to also start all the files
in the autostart folder, but does that without checking which should be
started. I'm not sure why both KSMServer and KLauncher are overlaping
and doing the same thing. But it seems that KLauncher is the correct
place to do this. Specially since ksmserver uses kioclient5 in order to
start the applications.
BUG: 335878
REVIEW: 118977
This reverts commit c2f4588431.
Apparently this can cause the login sequence to wait for PulseAudio and
can delay the startup quite considerably, so temporarily reverting.
REVIEW: 118636
CCBUG: 335948
Conflicts:
ksmserver/plasma_workspace.notifyrc
runUserAutostart should look into users dirs,
and the port from KGlobalSettings::autostartPath overlooked this,
so system location was used instead
BUG: 335970
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
techbase wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:
http://community.kde.org/Frameworks/GitOldHistory
If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.
Branched from the monolithic repo kde-workspace, frameworks branch, at commit
049113e719dd2fc4446d054fa1a3aada330094f0