Bug 441616 - Some global shortcuts / hotkeys like Meta+E or PrintScreen do not work when systemd startup is enabled
Summary: Some global shortcuts / hotkeys like Meta+E or PrintScreen do not work when s...
Status: REPORTED
Alias: None
Product: frameworks-kglobalaccel
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.85.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-27 16:09 UTC by Vladimir Yerilov
Modified: 2021-10-02 13:44 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Journalctl logs (97.22 KB, text/x-log)
2021-09-04 14:07 UTC, Vladimir Yerilov
Details
attachment-26098-0.html (227 bytes, text/html)
2021-09-08 08:38 UTC, David Edmundson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Yerilov 2021-08-27 16:09:25 UTC
SUMMARY
With new way of starting Plasma using systemd some global shortcuts do not work anymore until I switch back to traditional way. I feel like this has begun since 5.85 frameworks update but not sure though.

STEPS TO REPRODUCE
1. run kwriteconfig5 --file startkderc --group General --key systemdBoot true
2. log out, log in
3. press Meta+E

OBSERVED RESULT
Dolphin does not start as it would've been supposed to.

EXPECTED RESULT
Dolphin and Spectacle shortcuts should trigger actions set in Systemsettings.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
And btw, during session start-up there's a blinking message in a window I can't read since it goes off too fast. Only observed with systemd startup and thus possibly related.
Sometimes (very seldom, really) shortcuts do work. But I couldn't grasp why was that.
Pls request anything I can provide since I have no idea what should I do to trace this up to the culprit.
Comment 1 Vladimir Yerilov 2021-08-27 16:15:45 UTC
Additional info:
X11, dual monitor setup, 2 keyboard layouts + fcitx5, 2 physical keyboards.
Comment 2 Nate Graham 2021-08-28 02:40:39 UTC
Works for me with systemd boot, so it's not a universal thing.

Other global shortcuts work though, right? For example does Meta+D show the desktop?
Comment 3 Vladimir Yerilov 2021-08-30 13:15:09 UTC
@Nate: Yes, other shortcuts do work.

It wasn't easy, but after 2 days of numerous attempts, I found that the reason of this strange behavior. In [Wallet] section of ~/.config/kwalletrc some of these strings are the culprit:
Idle Timeout=10
Launch Manager=true
Leave Manager Open=false
Leave Open=true
Prompt on Open=true
Use One Wallet=true

If this could be reproduced, I think it should be considered a bug.
Comment 4 Nate Graham 2021-08-30 14:01:01 UTC
That's very strange. So everything works if you remove those lines from ~/.config/kwalletrc?
Comment 5 Vladimir Yerilov 2021-08-30 17:02:12 UTC
>>very strange

Indeed. It started to work as soon as I deleted those lines. At first I discovered that deleting the files solves the problem, then I started to gut it into slices according to its sections and try them one by one. These six lines were the last step and I had no time to proceed.
Btw, the problem I talked about in comments to your last blog post (about Night Color) also got resolved with this. It seems like this thing somehow prevents Plasma from normal start-up. And I don't understand how and why as well.

I'm planning to try one more time: remove all files from ~/.config to make a default configuration files to be created on the next boot, then add there the original kwalletrc file + startkderc with "systemdBoot=true" in it.
But I doubt that it will make a difference. I already tried a similar approach before with exactly the same result.
Comment 6 Vladimir Yerilov 2021-08-31 07:14:07 UTC
Also I had another problem related to this config file. With those strings in place I couldn't launch Konsole using a respective Dolphin's toolbar button. It simply had no effect at all. After removing those lines, it all went back to normal.
I also have a bunch of other strange issues related to Plasma start-up that are not observed if wiping ~/.config files (without folders) only. Since my Plasma install is quite old (2017) now, I think it is an inevitable consequence of accumulation of various (probably conflicting) settings.
Comment 7 Nate Graham 2021-08-31 14:55:19 UTC
Thanks for the info. Unfortunately I have no idea what could be causing this.
Comment 8 Vladimir Yerilov 2021-09-01 07:43:44 UTC
So this is surely kwallet issue.
1 config line responsible for this behavior is "Launch Manager=true".
In System Settings it is checkbox named "Show manager in system tray".
When ticked active, it causes the following under Plasma systemd boot:
1. Some shortcuts stop working.
2. Night Color do not auto-apply color temperature in the evening.
3. Dolphin's button for launching Konsole fails to execute its action.

I guess this should be re-assigned to kwallet bugs.
Could someone please try to reproduce this bug? I want to be sure that it's not something applicable to my system only.
Comment 9 David Edmundson 2021-09-01 13:00:12 UTC
>I guess this should be re-assigned to kwallet bugs.

Please don't, it won't be kwallet directly at fault as that makes no sense.

Please include output of "journalctl --user -b" from a time where you had these issues, maybe it will provide a clue.
Comment 10 Vladimir Yerilov 2021-09-04 14:07:31 UTC
Created attachment 141289 [details]
Journalctl logs

Hi David, here it is: the output of `journalctl --user -b --no-pager --no-hostname -p6 |grep -v conky` (filtered most garbage messages).

I noticed that another user session, which is very close to defaults, does not suffer from setting Kwallet to autolaunch so you might be right that it's something else.
Comment 11 Maxime Poulin 2021-09-08 06:19:26 UTC
I'm also having this issue, and setting "Launch Manager=false" in kwalletrc also fixed it for me.

I was able to reproduce on a completely fresh user by:
1. Create user with "useradd -m testbug" + "passwd testbug"
2. Log into session (via SDDM)
3. Enable systemd startup
4. Create a KDE Wallet and enable the tray application
5. Log out and back in

After these steps, pressing Meta+E no longer launches Dolphin. It still however launched Konsole when pressing Ctrl+Alt+T, contrary to my main user which can't. My main user also seems unable to launch Spectacle for screenshots pressing the PrintScreen key as well as most other global application shortcuts. My script shortcuts (in Shortcuts -> Custom Shortcuts) worked just fine, including GUI/access to X11.

On both users, setting "Launch Manager=false" restores functionality to normal, as well as disabling systemd startup.


One strange oddity is that setting "Launch Manager=false" on my main session also made my ssh-agent work again somehow. I thought it was broken because of systemd startup, but it does use kwallet via ksshaskpass to load the keys. I would have expected disabling the manager to break it however, not fixing it... I tried replicating the ssh-agent setup on the test user, but was unable to make it work at all with systemd startup. The ssh-agent setup works just fine without systemd startup on the test user, regardless of the "Launch Manager" setting, just like on my main user.

This smells like a race condition related to the order at which units gets started when using the new systemd startup, and may vary from machine to machine.


System is a fully up to date ArchLinux.
Operating System: Arch Linux
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Comment 12 David Edmundson 2021-09-08 08:38:25 UTC
Created attachment 141380 [details]
attachment-26098-0.html

This is an odd line:
Sep 04 23:00:15 ksmserver[2652]: QDBusConnection: name
'org.kde.kglobalaccel' had owner '' but we thought it was ':1.20'
Comment 13 Vladimir Yerilov 2021-10-02 13:44:35 UTC
>>This smells like a race condition related to the order at which units gets started when using the new systemd startup, and may vary from machine to machine.

Indeed it looks like that.

It's weird but this issue is gone now without me doing anything specific about it. I just had returned to good old non-systemd way of logging in, but a couple of weeks ago switched back to systemd-enabled one, and since then there has been no this issue, Kwallet Manager also started to load fine, which wasn't the case before. :shrug: