Bug 430691 - Some kde apps, when run from xfce4, are launching kdeinit5 and damaging (hijacking) system settings.
Summary: Some kde apps, when run from xfce4, are launching kdeinit5 and damaging (hija...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kglobalaccel
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-22 02:47 UTC by lockywolf
Modified: 2024-03-03 14:05 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
qtdebug output (9.02 KB, text/plain)
2020-12-22 02:47 UTC, lockywolf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lockywolf 2020-12-22 02:47:25 UTC
Created attachment 134258 [details]
qtdebug output

SUMMARY

I (as many other people) use xfce4 as an everyday DE. Meanwhile (a) other people use KDE5 on the same machine, (b) I use certain KDE5 applications, such as kMyMoney and Dolphin.

On KDE4 this used to work fine. However, after an overwhelming update to KDE5, I found that launching kmymoney or dolphin modifies certain system settings (at least the default file manager and application runner). When I started to investigate how this happens, I found that krunner is launched by kdeinit5.

I installed a hook in place of kdeinit5, which would log its executions and launch the original kdeinit5 after. This is how I found that certain KDE5 apps start kdeinit5 as they are launched, and certain KDE5 apps do not.

In particular, the ones which do include: kmymoney, dolphin, akregator, backup.
The ones which do not include: konsole, kalarm, kalgebra, kaddresbook, kate, konqueror. 

STEPS TO REPRODUCE
1. Log into xfce4
2. run dolphin
3. observe that your Alt+F2 now launches krunner instead of xfce4-apprunner.

OBSERVED RESULT

Keybindings are hijacked globally.

EXPECTED RESULT

KDE apps work the way they used to work in KDE4.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Slackware-current, Linux 5.10.1, glibc 2.30
(available in About System)
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: Qt 5.15.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 10.2.0) on "xcb"

ADDITIONAL INFORMATION
qtdebug output is attached.
Comment 1 Nicolas Fella 2020-12-22 13:49:32 UTC
I installed dolphin and akregator on OpenSUSE XFCE and neither the default filemanager nor the Alt-F2 shortcut were altered
Comment 2 lockywolf 2020-12-22 14:07:15 UTC
I will rebuild KDE with -ggdb and try to intercept the stack trace at the time when kdeinit5 is launched.
Comment 3 Nicolas Fella 2021-03-24 19:41:08 UTC
I noticed that some apps seem to activate the kglobalaccel service, which is responsible for the global shortcuts on Plasma. In theory that would explain the shortcut behavior you are seeing, but even with kglobalaccel5 running I don't see unusual behavior in my XFCE session
Comment 4 lockywolf 2021-03-25 01:40:27 UTC
(In reply to Nicolas Fella from comment #3)
> I noticed that some apps seem to activate the kglobalaccel service, which is
> responsible for the global shortcuts on Plasma. In theory that would explain
> the shortcut behavior you are seeing, but even with kglobalaccel5 running I
> don't see unusual behavior in my XFCE session

Firstly I would like to understand what is actually being launched by whom. Therefore I have created a separate issue about process reparenting.

https://bugs.kde.org/show_bug.cgi?id=434887
Comment 5 Bug Janitor Service 2021-04-10 15:13:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/19
Comment 6 Nicolas Fella 2021-04-26 11:10:17 UTC
Git commit 48c3376927e5e9c13377bf3cfc8b0c411783e7f3 by Nicolas Fella.
Committed on 19/04/2021 at 22:26.
Pushed by nicolasfella into branch 'master'.

Prevent kglobalaccel5 getting activated on non-Plasma systems

While in theory kglobalaccel works on any X11 system we don't want it to run on non-Plasma systems. It isn't very useful and may interfere with the desktop's native shortcut system.

Calling some API of KGlobalAccel may result in a DBus call to the daemon which then may launch by DBus activation. Prevent that from happening on non-Plasma systems.
Related: bug 435420

M  +80   -0    src/kglobalaccel.cpp

https://invent.kde.org/frameworks/kglobalaccel/commit/48c3376927e5e9c13377bf3cfc8b0c411783e7f3
Comment 7 lockywolf 2021-12-02 13:57:41 UTC
This bug used to not happen for quite a while, but with the most recent KDE, it seems to have reemerged.

In my case now it happens with krunner intercepting Super-Space, a shortcut typically used in GTK to open window properties.
Comment 8 lockywolf 2024-02-29 15:04:57 UTC
What is the status of this bug?

There was a merge request that fixed it: https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/19/commits?commit_id=48c3376927e5e9c13377bf3cfc8b0c411783e7f3

Then there was a merge request that temporarily reverted the patch, until KF6 is released:  https://invent.kde.org/frameworks/kglobalaccel/-/commit/9a48818abf50340e31d718cc675501dec6c51429
>This sort of behavior change probably needs to be made during a major transition like KF6

Now that KF6 has been release, I do not see a revert of the reversal in the kglobalaccel commit list. But maybe it has been fixed somewhere else?
Comment 9 Nicolas Fella 2024-03-03 14:05:21 UTC
It was addressed, but in a different way.

The runtime component was split from the application-side library into a different package, so installing an application doesn't install the shortcuts runtime. And even if it is installed it will not be started automatically when an application tries to talk to it.

Instead the runtime is started as part of a Plasma session or manually, but never implicitly on non-Plasma