Bug 419148 - Screenshots saved to the clipboard are cleared after 5 seconds/when the notification disappears
Summary: Screenshots saved to the clipboard are cleared after 5 seconds/when the notif...
Status: RESOLVED INTENTIONAL
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 19.12.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-23 15:28 UTC by lollilol
Modified: 2023-05-02 22:38 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
lollilol: Usability+


Attachments
Works for me (1.33 MB, video/webm)
2020-03-23 16:56 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lollilol 2020-03-23 15:28:23 UTC
OVERVIEW
Whenever i execute "spectacle -rbc" and select an area, the screenshot gets copied to my clipboard. But is cleared after 5 seconds / when the notification - that tells me that my screenshot was copied to my clipboard - dissapears


STEPS TO REPRODUCE
1. install spectacle
2. execute "spectacle -rbc"
3. select a region

OBSERVED RESULT
screenshot is cleared / gone from the clipboard after exactly 5 seconds.

EXPECTED RESULT
screenshot should stay in clipboard to the point where i copy something different.

SOFTWARE/OS VERSIONS
Linux Kernel: 5.4.24-1-MANJARO
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1

ADDITIONAL INFORMATION
When i disable the notification popups from spectacle in the notification settings in kde the problem seems to have gone away and the screenshot is preserved permanently in the clipboard.
Comment 1 Nate Graham 2020-03-23 16:56:38 UTC
Created attachment 126972 [details]
Works for me

Works for me.
Comment 2 Nate Graham 2020-03-23 16:57:02 UTC
Cannot reproduce; the notification times out, but the screenshot remains in the clipboard. See the attached screen recording. Does the same thing not work for you?
Comment 3 Bug Janitor Service 2020-04-07 04:33:13 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 lollilol 2020-04-07 13:32:37 UTC
(In reply to Nate Graham from comment #2)
> Cannot reproduce; the notification times out, but the screenshot remains in
> the clipboard. See the attached screen recording. Does the same thing not
> work for you?

I had disabled this clipboard display thingy.

Im sorry but im a little bit stuck with windows as of now (my linux installation doesnt work and a clean install wont help & i have to do things for work)
Comment 5 odzinic 2020-11-11 03:19:59 UTC
I am experiencing a similar issue using the spectacle shortcuts (capture active window, capture rectangular region, etc.). I ran a timer to ensure that the clipboard was not being cleared before the notification disappears and can confirm that it is as soon as the notification clears. If I take a screenshot with the spectacle gui open, which does not create a notification upon taking the screenshot, the screenshot will stay in the clipboard until it is replaced by something else.

System information:

Operating System: Manjaro Linux
KDE Plasma Version: 5.20.2
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Kernel Version: 5.8.18-1-MANJARO
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-6700K CPU @ 4.00GHz
Memory: 15.6 GiB of RAM
Graphics Processor: GeForce GTX 1080 Ti/PCIe/SSE2
Comment 6 odzinic 2020-11-11 03:27:59 UTC
I actually just came across something interesting after trying to replicate Nate's example. If the Clipboard System Service is set to Disabled in the System Tray Settings, this issue occurs for both spectacle -rbc and using the spectacle screenshots. If the Clipboard System Service is enabled (always hidden, always shown, show when relevant) then the issue does not occur and the screenshot will stay in the clipboard after the notification clears.
Comment 7 Michal Kec (MiK) 2020-11-15 15:41:26 UTC
I can confirm reported behavior with KDE Neon 5.20, thus I can provide further details. I believe you only need to meet two conditions to reproduce the bug:

1. In systray settings set the item Clipboard (Klipper) as "disabled". (See reporters note in comment #4)
2. Terminate the spectacle process after taking the screenshot. It can be either spontaneous (by running on background with -b parameter), or intentional by closing the app window.

Typically in Linux/X Window system the content of the clipboard exist as long as the parent process (Spectacle in this case) lives. By running Spectacle on background you have only few seconds - then the process vanishes and the clipboard content as well.
The Clipboard systray widget somehow steals (copies and caches) the Spectacle's clipboard content and preserve it within. However if you don't want to have clipboard history and disable this widget, well... you have no clipboard history.

Hopefully there's a workaround for users scared by clipboard history. 
1. Set the Clipboard systray widget as "hidden". (Disappears from systray and move to "Hidden icons" menu.)
2. Configure Klipper and set "Save clipboard contents on exit" as false and "Clipboard history size" as "1".
Comment 8 Anders Aagaard 2021-08-02 07:46:45 UTC
I'm seeing some... curious behavior on this as well.

with clipboard enabled and hidden, spectacle -r -b -c used to capture screenshots.

1. After taking the screenshot, while spectacle notification running. I can paste the screenshot into any application.
2. When the notification disappears I can no longer paste it. However.. it still exists in the clipboard list.
3. If I click on the entry in the clipboard list, I can paste it into any application again.

This is definitely not working the way my brain expects it to work 😂
Comment 9 Méven Car 2021-08-18 18:45:25 UTC
(In reply to Anders Aagaard from comment #8)
> I'm seeing some... curious behavior on this as well.
> 
> with clipboard enabled and hidden, spectacle -r -b -c used to capture
> screenshots.
> 
> 1. After taking the screenshot, while spectacle notification running. I can
> paste the screenshot into any application.
> 2. When the notification disappears I can no longer paste it. However.. it
> still exists in the clipboard list.

If the source application doesn't exist anymore, how would you expect it to send data.

> 3. If I click on the entry in the clipboard list, I can paste it into any
> application again.
> 
> This is definitely not working the way my brain expects it to work 😂

The clipboard list is klipper, our clipboard manager that keeps clipboard values cached for this kind of use case.

It is a quite tricky issue to solve.
We could make it so that the application stays open until an application has received the data, that isn't klipper.
Or the notification should copy the data itself to make it available, and remove it afterwards.
Or the notification could fetch the data from klipper somehow, if klipper cached the value.

Please not, under wayland the -b command line is not supported, code needs some adaptation, you will have strange behavior for now.
Comment 10 Anders Aagaard 2021-08-20 15:08:07 UTC
(In reply to Méven Car from comment #9)
> (In reply to Anders Aagaard from comment #8)
> > I'm seeing some... curious behavior on this as well.
> > 
> > with clipboard enabled and hidden, spectacle -r -b -c used to capture
> > screenshots.
> > 
> > 1. After taking the screenshot, while spectacle notification running. I can
> > paste the screenshot into any application.
> > 2. When the notification disappears I can no longer paste it. However.. it
> > still exists in the clipboard list.
> 
> If the source application doesn't exist anymore, how would you expect it to
> send data.

As a developer I understand that, but as a end user the mental model I think of with copy and paste is "lifting" content out of one application and putting it in another.

> It is a quite tricky issue to solve.

It might be hard to solve well... but couldn't spectacle be modified to keep the process alive for .. 30 seconds? - or until the content is pasted/clipboard changed or something like that? That wouldn't solve the underlying issue, but I think it would hide it from 90% of the users. 

My gut feeling is that 5 seconds is something quite a lot of users would run into, if you are switching back and forth between windows etc. 30 seconds../1 minute? Probably fairly rarely.
Comment 11 Noah Davis 2023-05-02 22:38:53 UTC
I was able to reproduce this with version 23.04, but I don't think it's work spending much effort on fixing. If there is no clipboard managing service, anything you copy from an app just isn't preserved when the app is closed, even text. I strongly recommend keeping the clipboard service enabled or not using the `-b` option if you have it disabled.