Bug 467231 - After taking a screenshot from the command line with `spectactle -bcr`, Spectactle does not exit
Summary: After taking a screenshot from the command line with `spectactle -bcr`, Spect...
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: git-master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-12 09:08 UTC by Oded Arbel
Modified: 2023-03-13 21:44 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 Oded Arbel 2023-03-12 09:08:00 UTC
SUMMARY
Spectactle does not exit after taking a "background" region screenshot to the clipboard from the command line.

STEPS TO REPRODUCE
1. In a terminal run `spectactle -bcr`
2. In the UI that opens select a region and press ENTER (or double click)

OBSERVED RESULT
The `spectacle` command in the terminal does not exit and remains running until either the users enter s a break (CTRL+C) in the terminal, or the Spectactle app is launched normally and then quit manually.

EXPECTED RESULT
The `spectacle` command in the terminal should end automatically sometime after completing the copy operation - we can debate on when the operation is "complete", but when using Plasma clipboard manager, the command can quit immediately and the screenshot will still be available in the clipboard (I tested by taking a screenshot, then immediately CTRL+C the command, then going to another application and pasting the image).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: current neon unstable
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.10.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
The exit behavior caused by different combination of flags with `-b` is a bit weird (and interesting):
- `-bcr` : does not automatically exit at any point.
- `-br` : exits immediately after completing the screenshot.
- `-bc` / `-b`: exists after the notification is dismissed (manually or by timeout).

May be related to bug 463344.
Comment 1 Nate Graham 2023-03-13 21:23:16 UTC
Cannot reproduce when running `spectacle -bcr` with current git master. It's possible Neon is a bit behind due to the Qt 6 transition, though Spectacle hasn't been ported yet so there's no reason it should be delayed. Can you paste the version number of the spectacle package that `apt` reports?
Comment 2 Oded Arbel 2023-03-13 21:25:39 UTC
(In reply to Nate Graham from comment #1)
> Can you paste the version number of the spectacle package that `apt` reports?

It is 22.12.2+p22.04+tunstable+git20230225.1009-0
Comment 3 Nate Graham 2023-03-13 21:29:20 UTC
So yup, as I suspected, Neon Unstable's packages are old. That package was built on February 25th, so it doesn't include https://invent.kde.org/graphics/spectacle/-/commit/fc2d625144536b53e5f3e671341b4a5651857cf2 which fixed this issue.
Comment 4 Oded Arbel 2023-03-13 21:44:06 UTC
(In reply to Nate Graham from comment #3)
> So yup, as I suspected, Neon Unstable's packages are old. That package was
> built on February 25th, so it doesn't include
> https://invent.kde.org/graphics/spectacle/-/commit/
> fc2d625144536b53e5f3e671341b4a5651857cf2 which fixed this issue.

OK, I've just built from git master and I also cannot reproduce the reported behavior with that build - all combinations of background-mode screenshots exit after the notification is dismissed.