Bug 433883 - Spectacle isn't saving to clipboard whenever "Show message in a popup" is unticked and an alternative "Capture rectangular region" shortcut is defined
Summary: Spectacle isn't saving to clipboard whenever "Show message in a popup" is unt...
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 22.08.1
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
: 451763 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-02 22:22 UTC by heqromancer
Modified: 2022-10-15 21:21 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description heqromancer 2021-03-02 22:22:49 UTC
SUMMARY
Spectacle won't save to clipboard when the option to do so is enabled given a handful of conditions are met.

STEPS TO REPRODUCE
1. Define a custom shortcut for "Capture Rectangular Region" (in my case, Meta+Shift+S)
2. Configure Spectacle to Copy Image to the Clipboard after a screenshot is taken.
3. System Tray > Notifications applet > Configure Event Notifications and Actions... > Hit "Configure" at the right of the "Applications:" label
4. Select Spectacle from the list > Configure Events... > Untick "Show message in a popup"

OBSERVED RESULT
The screenshot does not get saved to the clipboard.

EXPECTED RESULT
The screenshot should be saved to the clipboard.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.21.1
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.11.1-1-MANJARO
OS Type: 64-bit
Graphics Platform: X11

ADDITIONAL INFORMATION
Making use of the default shortcut (Meta+Shift+Print) won't cause this problem on my end.
Comment 1 hexchain 2022-09-17 07:51:51 UTC
I can still reproduce this issue with spectacle 22.08.1.

Operating System: Arch Linux
KDE Plasma Version: 5.25.90
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Graphics Platform: Wayland
Comment 2 Bharadwaj Raju 2022-10-03 09:59:13 UTC
So what happens is that if notifications are disabled like that, the KNotification object in Spectacle is destroyed immediately, and my guess is that this is causing Spectacle to exit before the clipboard can be set. It doesn't seem to matter what the shortcut is, though.

I wonder if just adding a short timer before emitting allDone would be enough.
Comment 3 Bug Janitor Service 2022-10-03 10:04:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/154
Comment 4 Bharadwaj Raju 2022-10-03 11:00:13 UTC
*** Bug 451763 has been marked as a duplicate of this bug. ***
Comment 5 Bharadwaj Raju 2022-10-15 21:21:33 UTC
Git commit 0a5967b069e2016ec3fe7d4610784370aad7e70f by Bharadwaj Raju.
Committed on 15/10/2022 at 21:20.
Pushed by bharadwaj-raju into branch 'master'.

Add a small delay before exiting when notification is destroyed

The destruction of the notification object happens immediately if
Spectacle is blocked from showing notifications, and in such cases
it exits before data can be copied to the clipboard.

M  +5    -3    src/SpectacleCore.cpp

https://invent.kde.org/graphics/spectacle/commit/0a5967b069e2016ec3fe7d4610784370aad7e70f