Bug 447517 - Two notifications are shown after each screen capture
Summary: Two notifications are shown after each screen capture
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 21.12.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-25 23:34 UTC by medin
Modified: 2022-02-10 11:48 UTC (History)
4 users (show)

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


Attachments
Two notifications are shown after each screen capture (150.30 KB, image/png)
2021-12-25 23:34 UTC, medin
Details
Spectacle settings (65.75 KB, image/png)
2021-12-29 10:50 UTC, medin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description medin 2021-12-25 23:34:13 UTC
Created attachment 144867 [details]
Two notifications are shown after each screen capture

When I take a screenshot I see two notifications, see attached image for more info.

Operating System: Manjaro Linux
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.7-1-MANJARO (64-bit)
Graphics Platform: X11
Comment 1 Patrick Silva 2021-12-26 01:04:53 UTC
Related to bug 422874
Comment 2 Antonio Prcela 2021-12-28 21:35:06 UTC
How did you take the screenshot (keyboard shortcut, call from terminal)?
What settings do you have set in Spectacle?
Comment 3 medin 2021-12-29 10:49:05 UTC
(In reply to Antonio Prcela from comment #2)
> How did you take the screenshot (keyboard shortcut, call from terminal)?
> What settings do you have set in Spectacle?

With terminal and after trying all cases (region, full-screen, active window, window under cursor) it shows only one notification, but with shortcuts and in all cases it shows two notifications. Concerning spectacle settings see attached image.
Comment 4 medin 2021-12-29 10:50:07 UTC
Created attachment 144926 [details]
Spectacle settings
Comment 5 Antonio Prcela 2021-12-29 11:20:12 UTC
Can confirm now. Seems that when both options for "after taking a screenshot" are set:
"save file to default folder" - enabled
and
"copy image to clipboard"

Will take a look into it. Have a feeling where this is :)
Comment 6 Bug Janitor Service 2021-12-29 22:21:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/116
Comment 7 Nate Graham 2022-01-11 15:37:10 UTC
Git commit 08e82e2e0783c77b60b77aaa7018f517a52d1efd by Nate Graham, on behalf of Antonio Prcela.
Committed on 11/01/2022 at 15:37.
Pushed by ngraham into branch 'master'.

Simplify branching for the notify text and fix messages containing dots

Simplify the logic by removing the bool isBackgroundMode. Fix double notifications
where one has dots instead of the filename and save path.

Add missing notification text if mCopyLocationToClipboard is set. Uses 2in1
principle: Considering that when mCopyLocationToClipboard is true it means that
the image also gets saved as a file, so this makes the notification text show
both the path where it's saved & the name of it _and_ the information that the
file path has been added to the clipboard.
FIXED-IN: 22.04

M  +7    -9    src/SpectacleCore.cpp

https://invent.kde.org/graphics/spectacle/commit/08e82e2e0783c77b60b77aaa7018f517a52d1efd
Comment 8 Patrick Silva 2022-02-10 11:48:13 UTC
(In reply to Antonio Prcela from comment #5)
> Can confirm now. Seems that when both options for "after taking a
> screenshot" are set:
> "save file to default folder" - enabled
> and
> "copy image to clipboard"
> 
> Will take a look into it. Have a feeling where this is :)

two notifications bug is still reproducible on neon unstable.