Bug 466143

Summary: No notification after taking region screenshot
Product: [Applications] Spectacle Reporter: David Redondo <kde>
Component: GeneralAssignee: Boudhayan Gupta <me>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate
Priority: NOR    
Version: git-master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 23.04

Description David Redondo 2023-02-20 14:22:17 UTC
SUMMARY
When taking region screenshot using shortcut no notification is emitted afterwards.

STEPS TO REPRODUCE
1. run spectacle --dbus 
2. press shortcut
3. accept selection with enter

OBSERVED RESULT
- spectacle exits and no notification is shown


EXPECTED RESULT
- notification is shown

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: git master
KDE Frameworks Version: git master
Qt Version: 5.15.8 kde
Comment 1 Bug Janitor Service 2023-03-03 09:09:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/210
Comment 2 Noah Davis 2023-03-05 01:19:10 UTC
Git commit fc2d625144536b53e5f3e671341b4a5651857cf2 by Noah Davis.
Committed on 04/03/2023 at 18:24.
Pushed by ndavis into branch 'master'.

Use QEventLoopLocker to keep Spectacle alive for notifications

Stopped using setQuitOnLastWindowClosed(false) because setting it true
or false depending on the situation was too complex. Now we just create
a QEventLoopLocker when we make a notification and destroy the event
loop locker, which also automatically quits the application, when the
notification is destroyed. To close the windows, we use
SpectacleWindow::closeAll() instead of making them hidden. This
automatically closes Spectacle when the QEventLoopLocker has not been
created.
Related: bug 450001

M  +12   -8    src/Gui/SpectacleWindow.cpp
M  +5    -0    src/Gui/SpectacleWindow.h
M  +6    -17   src/SpectacleCore.cpp
M  +1    -0    src/SpectacleCore.h

https://invent.kde.org/graphics/spectacle/commit/fc2d625144536b53e5f3e671341b4a5651857cf2