Bug 447811 - Spectacle when run with "-bcr" on the commandline always saves a file
Summary: Spectacle when run with "-bcr" on the commandline always saves a file
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 21.08.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Antonio Prcela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-02 04:07 UTC by Kelvie Wong
Modified: 2022-02-26 11:10 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kelvie Wong 2022-01-02 04:07:57 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Run `spectacle -bcr` in the commandline, to take a rectangular area, and copy it to the clipboard without prompts.
2. Select a rectangular area


OBSERVED RESULT

The screenshot is in the clipboard, but it is also saved in ~/Pictures (which is my default save location, but I do not have spectacle configured to auto save screenshots)

EXPECTED RESULT

There not be a PNG file in my ~/Pictures directory, just the clipboard.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Ubuntu 21.10
(available in About System)
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Antonio Prcela 2022-01-09 09:53:53 UTC
Can confirm this behavior. But I'm not sure if this is on purpose that `-b` always saves as file even if using `-c` as addition, or if it is a bug.
Comment 2 Kelvie Wong 2022-01-15 22:06:21 UTC
I know it didn't do this before, one of the recent upgrades (at least to me) made it start doing it.
Comment 3 Antonio Prcela 2022-01-15 22:07:13 UTC
MR is on it's way:
https://invent.kde.org/graphics/spectacle/-/merge_requests/118
Comment 4 Nate Graham 2022-01-19 16:44:02 UTC
Git commit 1de84d561da89686c7059ffa83fa34cde55c1c42 by Nate Graham, on behalf of Antonio Prcela.
Committed on 19/01/2022 at 16:43.
Pushed by ngraham into branch 'master'.

Respect -c, in combination with -b, to only save image into clipboard

Rearranged code to check 'copy-image' before 'output', in case the command goes like:
spectacle -b -c -o ./file.png

So the file also gets saved. Otherwise, with the old arrangement, it would only save
to clipboard ignoring '-o'.
FIXED-IN: 22.04

M  +1    -1    doc/man-spectacle.1.docbook
M  +9    -7    src/SpectacleCore.cpp

https://invent.kde.org/graphics/spectacle/commit/1de84d561da89686c7059ffa83fa34cde55c1c42
Comment 5 Chandan Mahto 2022-02-18 10:45:02 UTC
Started to see this exact same issue in version 21.12.2.

SUMMARY
***
When trying to take a region screenshot in background and copying it to clip board. The image is copied in the clip board as well saved to file. This bug was not present in the previous versions.
***


STEPS TO REPRODUCE
1. open terminal and type spectacle -bcr.
2. select a region and press enter.

OBSERVED RESULT
Image copied to clipboard and saved to file.

EXPECTED RESULT
Image should be only copied to clipboard.

SOFTWARE/OS VERSIONS
Windows: -
macOS: -
Linux/KDE Plasma: Linux 5.15.21-1-lts with Arch
(available in About System)
KDE Plasma Version: 5.24.1
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 6 Antonio Prcela 2022-02-26 10:32:16 UTC
you got me there for a minute :)

see above: FIXED-IN: 22.04
Comment 7 Chandan Mahto 2022-02-26 11:10:00 UTC
(In reply to Antonio Prcela from comment #6)
> you got me there for a minute :)
> 
> see above: FIXED-IN: 22.04

Ah. Sorry, I saw the commit date and that it was pushed into 'master' so I thought I must have the latest version. Didn't see the FIXED-IN: 22.04 part there.