Bug 412186 - Multiple windows with spectacle take the same screenshot
Summary: Multiple windows with spectacle take the same screenshot
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 19.08.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-22 09:24 UTC by damiano38
Modified: 2020-06-05 09:31 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description damiano38 2019-09-22 09:24:47 UTC
Multiple windows with Spectacle take the same screenshot.

STEPS TO REPRODUCE
1. Take screenshot with Spectacle
2. Open another Spectacle window
3. Take screenshot in this new Spectacle window

OBSERVED RESULT
Both windows have now the same screenshot in it.

EXPECTED RESULT
Previous window should have keep that old screenshot and newer window just take new screenshot.
Comment 1 Nate Graham 2019-10-07 03:40:31 UTC
Cannot reproduce.
Comment 2 teemu.patana 2020-04-02 18:52:14 UTC
Seems like this happens when the capture mode is set to active window and include window titlebar and borders is turned on.
Comment 3 Méven Car 2020-05-06 14:43:22 UTC
Reproduced when both spectacle windows have capture mode set to active window and include window titlebar and borders turned on.
Comment 4 David Redondo 2020-05-11 13:29:48 UTC
Git commit b851ca17ae5788def7c181f04af9145ee0bb5e68 by David Redondo.
Committed on 11/05/2020 at 13:29.
Pushed by davidre into branch 'release/20.04'.

Disconnect after receiving screenshot signal

Summary:
Only the Spectacle instance that requested a screenshot will receive it.

Reviewers: meven, #spectacle

Reviewed By: meven

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D29620

M  +4    -0    src/Platforms/PlatformXcb.cpp

https://commits.kde.org/spectacle/b851ca17ae5788def7c181f04af9145ee0bb5e68
Comment 5 Méven Car 2020-06-05 09:31:33 UTC
Git commit dec0e6cef23ac35754aa537db6d7ace42b23ca2a by Méven Car.
Committed on 05/06/2020 at 09:10.
Pushed by meven into branch 'master'.

Refactor Spectacle to run in single instance mode with KDBusService::Unique

Summary:
Since Spectacle got DBus activation support in 09cd11881d828da35c46c48da79f2d988e6a78cc, it has been run in multiple instance mode.
But it has been shaddowed by using qbus ee862d161a480408338d00b8826c915f7a97575c in the desktop file to mimic singleton behavior.

This refactors Spectacle to run in true single instance mode using KDBusService::Unique.
This is to allow Spectacle to have its executable in its Exec desktop Entry, to allow KWin to match the executable to the service file, itself to allow screenshots under Wayland without intermediate click.

The listed bugs are fixed incidently except for 414739 where a simple fix was added in screenShotUpdated.
Related: bug 420477, bug 414739

Test Plan:
Start spectacle, alternatively, from shortcut, command line.
Take screenshots, from alternative ways.

There is always at most one Spectacle window unless launched with `--new-instance`.

Reviewers: davidre, ngraham, bport, davidedmundson, apol

Reviewed By: davidre

Subscribers: broulik, anthonyfieroni, #spectacle

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D29487

M  +2    -2    desktop/org.kde.spectacle.desktop.cmake
M  +30   -89   src/Main.cpp
M  +170  -105  src/SpectacleCore.cpp
M  +8    -10   src/SpectacleCore.h
M  +5    -10   src/SpectacleDBusAdapter.cpp
M  +0    -31   src/SpectacleDBusAdapter.h

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