Bug 450001 - Spectacle closes when a notification generated by it disappears
Summary: Spectacle closes when a notification generated by it disappears
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 22.12.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-11 11:29 UTC by Patrick Silva
Modified: 2023-03-11 04:03 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2022-02-11 11:29:57 UTC
SUMMARY
Can reproduce on both X11 and Wayland sessions.

STEPS TO REPRODUCE
1. open Spectacle by pressing printscreen key
2. make sure 'Quit after manual Save or Copy' option is checked
3. save the screenshot (Spectacle closes and Plasma shows a notification)
4. open Spectacle again while the notification is visible
5. wait for the notification to disappear

OBSERVED RESULT
Spectacle closes when the notification disappears

EXPECTED RESULT
Spectacle remains open when the notification disappears

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 1 Bug Janitor Service 2023-03-03 09:09:27 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:01 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 466143

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