The global shortcuts for taking screenshots with Spectacle (Print Screen and its modifier derivates) only work once. STEPS TO REPRODUCE 1. Press Print 2. Close Spectacle 3. Press Print again OBSERVED RESULT Nothing happens EXPECTED RESULT Spectacle opens again SOFTWARE/OS VERSIONS Linux/KDE Plasma: git master as of 2023-01-22 ADDITIONAL INFORMATION Spectacle uses actions defined in its desktop file for those shortcuts, however since the QML rewrite it also calls KGlobalAccel::self()->setGlobalShortcut in its SpectacleCore.cpp. This has KGlobalAccel track the shortcut and set it "inactive" when the app quits because the action normally couldn't be invoked with the app gone. It didn't surface until now where Spectacle actually quits properly again after taking a screenshot. The reason for calling KGlobalAccel isn't clear and might be superfluous, since the actions are handled by the desktop file. If the shortcut is shown in the UI, then I think something else needs to be done than call KGlobalAccel.
Can confirm. Seems to have started happening in the last day or two.
Can confirm. I though I was going insane
(In reply to Kai Uwe Broulik from comment #0) > Spectacle uses actions defined in its desktop file for those shortcuts, > however since the QML rewrite it also calls > KGlobalAccel::self()->setGlobalShortcut in its SpectacleCore.cpp. > This has KGlobalAccel track the shortcut and set it "inactive" when the app > quits because the action normally couldn't be invoked with the app gone. > It didn't surface until now where Spectacle actually quits properly again > after taking a screenshot. > The reason for calling KGlobalAccel isn't clear and might be superfluous, > since the actions are handled by the desktop file. If the shortcut is shown > in the UI, then I think something else needs to be done than call > KGlobalAccel. It used `KGlobalAccel::self()->setGlobalShortcut()` before the rewrite though. They were done in `SpectacleCore::setUpShortcuts()`, but that function did exactly the same thing as what is being done now. It also should have been closing properly before the rewrite and it only didn't close properly for certain modes after the rewrite, so I'm still not sure why the issue has come up now. `setGlobalShotcut()` seems to be needed in order to actually set a default key sequence for a global shortcut.
The actions are now properly cleaned up since https://invent.kde.org/graphics/spectacle/-/commit/dbb7e5c507c51b2974ebab2e7b69d33ac8bc7dc0
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/187
Git commit aa51a0bdad4d861240227dfb80d67f7c856e467d by Noah Davis. Committed on 25/01/2023 at 11:07. Pushed by ndavis into branch 'master'. Fix global shortcuts only working once This happened because the actions were given a parent in a previous commit. They worked more than once before the commit because the actions were being leaked. `action->setProperty("isConfigurationAction", true)` fixes the single use action problem. M +7 -0 src/ShortcutActions.cpp https://invent.kde.org/graphics/spectacle/commit/aa51a0bdad4d861240227dfb80d67f7c856e467d
*** Bug 465014 has been marked as a duplicate of this bug. ***