Bug 484597 - PrintScreen shortcut lost during upgrade
Summary: PrintScreen shortcut lost during upgrade
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: 24.02.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
: 487397 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-27 13:11 UTC by Szőts Ákos
Modified: 2026-05-07 21:46 UTC (History)
10 users (show)

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


Attachments
Shortcuts screenshot (140.43 KB, image/png)
2024-03-27 18:13 UTC, Szőts Ákos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Szőts Ákos 2024-03-27 13:11:38 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY

If I press the "Print screen" button on my keyboard, nothing happens.

EXPECTED RESULT

Spectacle starts

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240318
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.9-1-default (64-bit)
Graphics Platform: X11
Comment 1 Szőts Ákos 2024-03-27 13:15:31 UTC
I came from an old KDE installation, so it's not a fresh install.
Comment 2 fanzhuyifan 2024-03-27 15:53:34 UTC
Could you go to system settings - shortcuts - spectacle, and provide a screenshot of what shortcuts spectacle has assigned? (In particular check Default Shortcuts to see if it has print assigned)

If you run xev, and press the Print key, what do you see printed in the console?
Comment 3 Szőts Ákos 2024-03-27 18:13:58 UTC
Created attachment 167855 [details]
Shortcuts screenshot

It says Meta+Shift+Print. I'm 99% sure that I haven't set this shortcut.

I'm sorry that it's in Hungarian, but for some reason `LC_ALL=C.UTF-8 systemsettings` doesn't change the individual KCM pages to English (just the main window). I hope that the localisation doesn't change the order and you can match with your setup.

This is what xev reports back for pressing and releasing the print screen button:

KeyPress event, serial 41, synthetic NO, window 0x4400001,
    root 0x1e1, subw 0x0, time 60011851, (1094,485), root:(1097,521),
    state 0x10, keycode 107 (keysym 0xff61, Print), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x4400001,
    root 0x1e1, subw 0x0, time 60011971, (1094,485), root:(1097,521),
    state 0x10, keycode 107 (keysym 0xff61, Print), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
Comment 4 fanzhuyifan 2024-03-27 18:59:11 UTC
(In reply to Szőts Ákos from comment #3)
> Created attachment 167855 [details]
> Shortcuts screenshot
> 
> It says Meta+Shift+Print. I'm 99% sure that I haven't set this shortcut.
> 
> I'm sorry that it's in Hungarian, but for some reason `LC_ALL=C.UTF-8
> systemsettings` doesn't change the individual KCM pages to English (just the
> main window). I hope that the localisation doesn't change the order and you
> can match with your setup.
> 
> This is what xev reports back for pressing and releasing the print screen
> button:
> 
> KeyPress event, serial 41, synthetic NO, window 0x4400001,
>     root 0x1e1, subw 0x0, time 60011851, (1094,485), root:(1097,521),
>     state 0x10, keycode 107 (keysym 0xff61, Print), same_screen YES,
>     XLookupString gives 0 bytes: 
>     XmbLookupString gives 0 bytes: 
>     XFilterEvent returns: False
> 
> KeyRelease event, serial 41, synthetic NO, window 0x4400001,
>     root 0x1e1, subw 0x0, time 60011971, (1094,485), root:(1097,521),
>     state 0x10, keycode 107 (keysym 0xff61, Print), same_screen YES,
>     XLookupString gives 0 bytes: 
>     XFilterEvent returns: False

For "Spectacle", is "Print" selected as the default shortcut? Also, it would be great if you could upload the content of your  `~/.config/kglobalshortcutsrc`.

Just looking at the screenshot, it seems that `Print` is not assigned as a shortcut for anything. So spectacle doesn't launch when you press print. It should be the default shortcut for "Spectacle". Maybe you removed that at some point?
Comment 5 Szőts Ákos 2024-03-27 20:02:31 UTC
This is the relevant section for Spectacle from the file:

[services][org.kde.spectacle.desktop]
ActiveWindowScreenShot=none
FullScreenScreenShot=none
RectangularRegionScreenShot=none
_launch=Meta+Shift+Print

Apart from it, do you need the full config file?

I remember Print Screen disappeared (or never appeared) during the change of KSnapshot -> Spectacle change. If I recall correctly, during KSnapshot time it wasn't always bound to start that application and I think I never received this functionality.

I can, of course, bind it, but that won't help for the other long-time users who have the same problem and therefore I don't want alter the current debuggable configuration.
Comment 6 Christophe Marin 2024-04-19 09:32:21 UTC
Do you have more than one monitor?

Does the window appear if you run 'spectacle -a' or 'spectacle -l' ?
Comment 7 Szőts Ákos 2024-04-22 06:57:49 UTC
No, I have only one monitor with multiple inputs. Spectacle starts for both kinds of invocation.
Comment 8 fanzhuyifan 2024-04-22 14:37:32 UTC
> I remember Print Screen disappeared (or never appeared) during the change of KSnapshot -> Spectacle change. If I recall correctly, during KSnapshot time it wasn't always bound to start that application and I think I never received this functionality.

Ahh that was several years ago and if that was indeed the issue we can't do anything about it now..
Comment 9 tneo 2024-05-02 15:23:41 UTC
I have the exact same grievance. After updating to 

Operating System: openSUSE Tumbleweed 20240430
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.8.8-1-default (64-bit)

The shortcuts for Spectacle are de-activated. I have to go into settings and set all the shortcuts active again (I'm using the default assigned). The remnants of conflicting shortcuts I manually removed from the config file. It is not clear what triggers the reset of the shortcuts for spectacle as it was doing ok for a while.
Comment 10 Ricardo J. Barberis 2024-05-18 21:40:36 UTC
Could this be an openSUSE issue?
I haven't experienced this bug with Fedora 38/39/40 nor before with Slackware 14/15/-current.
Comment 11 Christophe Marin 2024-05-21 10:09:32 UTC
(In reply to Ricardo J. Barberis from comment #10)
> Could this be an openSUSE issue?
> I haven't experienced this bug with Fedora 38/39/40 nor before with
> Slackware 14/15/-current.

probably not, we don't have anything changing global shortcuts
Comment 12 duha.bugs 2024-05-23 16:18:37 UTC
*** Bug 487397 has been marked as a duplicate of this bug. ***
Comment 13 duha.bugs 2024-05-23 16:19:21 UTC
Can you check if this fixes the issue for you? https://discuss.kde.org/t/spectacles-global-shortcuts-reset-after-reboot/15882
Comment 14 tneo 2024-06-11 19:16:20 UTC
This is the most annoying bug I have experienced with KDE Plasma in a while. I have Spectacle using the default shortcuts (which has a conflicting shortcut for recording a window btw) and the shortcuts get reset every time to nothing. I had 2 Spectacles listed, but that was not the issue. I reverted everything to default and that did not resolve anything either. It appears related to upgrade process, but I have not found which update breaks the shortcuts.
Comment 15 waterlubber 2025-02-09 16:45:54 UTC
Try removing ~/.local/share/kglobalaccel - I think that fixed the issue for me.
Comment 16 Vlad Zahorodnii 2026-04-29 11:57:32 UTC
Do you still hit this bug?
Comment 17 tneo 2026-04-29 13:33:48 UTC
(In reply to Vlad Zahorodnii from comment #16)
> Do you still hit this bug?

I have not encountered this anymore. Seems to be fixed indirectly.
Comment 18 Bug Janitor Service 2026-04-30 08:41:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kglobalacceld/-/merge_requests/99
Comment 19 Vlad Zahorodnii 2026-05-07 12:42:50 UTC
Git commit d62b708c04a0518bf119ed50c0fcc8610361efe0 by Vlad Zahorodnii.
Committed on 05/05/2026 at 09:21.
Pushed by vladz into branch 'master'.

Avoid resetting global shortcut keys without explicit user input

KGlobalAccelD tries to do a noble and a reasonable (at quick glance)
thing such as manage contested global shortcut keys. But KGlobalAccelD
can even do that without user's knowledge. For example, with some
package managers, applications can be uninstalled and installed, there
is a lot of uncertainty.

This change makes KGlobalAccelD to be more conservative so it doesn't
try to reset user configuration without user's input. If the user wants
to re-assign a global shortcut, they will be asked that in system
settings. If a particular shortcut is contested, then KGlobalAccelD will
try to make the best of it and activate an action that was registered
with that shortcut first.

M  +32   -0    autotests/shortcutstest.cpp
M  +11   -16   src/globalshortcut.cpp

https://invent.kde.org/plasma/kglobalacceld/-/commit/d62b708c04a0518bf119ed50c0fcc8610361efe0