Bug 480448 - Randomly fails to copy to clipboard
Summary: Randomly fails to copy to clipboard
Status: NEEDSINFO WAITINGFORINFO
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 23.08.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-28 16:55 UTC by php4fan
Modified: 2025-03-06 03:47 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description php4fan 2024-01-28 16:55:59 UTC
SUMMARY
I have Spectacle configured to copy screenshots to clipboard.

Usually it does, but a minute ago I tried to take a screenshot, and it just wasn't copying anything to the clipboard (I went to paste the screenshot into Gimp and it said there was no image data in the clipboard). I retried several times with the same result.


STEPS TO REPRODUCE
1.  Use Super+Shift+PrintScr to take a screenshot of a rectangular region
2.  Select rectangular region and hit Enter
3. A notification pops up saying "A screenshot has been saved to your clipboard", so go to paste it somewhere

OBSERVED RESULT
There was nothing in the clipboard. I retried like seven times, nothing.

Then I took another screenshot, and instead of just hitting Enter, I explicitly clicked the "Copy" button in Spectacle's buttons bar.
This time it worked and after that, it started working every time even just hitting Enter, as expected.

EXPECTED RESULT
Should always copy the image to clipboard if it's configured to do so. If for whatever reason it fails to, it should tell me it failed, instead of showing a BS message saying that the screenshot has been copied to the clipboard.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.12
Kernel Version: 6.6.10-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 12 × 12th Gen Intel® Core™ i7-1255U
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: Vivobook_ASUSLaptop X1502ZA_F1502ZA
System Version: 1.0
Comment 1 Nate Graham 2024-02-06 23:47:46 UTC
Can you reproduce that it always fails to copy/paste while the notification is open, but always succeeds to copy/paste after the notification has disappeared on its own after 5 seconds?
Comment 2 php4fan 2024-02-07 13:17:54 UTC
> Can you reproduce that it always fails to copy/paste while the notification is open, but always succeeds to copy/paste after the notification has disappeared on its own after 5 seconds?

I don't know how to make sense of your question, unless when you say "copy/paste" you mean just "paste".
If that is the case, if what you meant is "paste", then the answer is no, I cannot reproduce that.

The sequence of events is:
- I hit the keyboard shortcut for capturing a rectangular region
- the tool shows up allowing me to select a region of the screen to capture
- when I'm happy with the selection I hit Enter.
=> This is when the screenshot is taken and this is the moment when it's supposed to be copied to clipboard (because that's how it's configured in the settings)
- and NOW the notification shows up saying the screenshot has been copied.

As I said, it usually works as expected, but there was this instance where it stopped working, and nothing would be copied. To copy after the notification is gone is impossible, because the notification appears exactly when (or immediately after, from a logical standpoint) the screenshot is supposedly copied to clipboard (that's what the notification says: that the screenshot has been copied to the clipboard). 

When this started happening, it was reproducing consistently, meaning I took several screenshots repeating the steps above and none of them was ever copied to the clipboard. I can't say with 100% certainty whether I was pasting before or after the notification had disappeared, but given that I am not particularly quick in my movements, I can bet money that at least some of the screenshot I took, I attempted to paste after the notification had gone. And now that it's working as expected, I have tested making sure I paste quickly before the notification vanishes, and it pastes as expected, so the copying is correctly done at the moment of taking the screenshot, as expected.

After I once copied manually by using the button in the tool, then not only it worked, but also the issue stopped happening and I haven't observed it again, so there's no reproducible pattern that I know of.

I hope that answers your question.
Comment 3 Nate Graham 2024-02-07 17:22:18 UTC
Thanks. Two more questions:
- Have you disabled clipboard history or otherwise changed any of the default clipboard settings?
- Does the issue reproduce when you take the screenshot in such a way that Spectacle's main window shows up instead of a system notification?
Comment 4 php4fan 2024-02-07 17:33:33 UTC
> Have you disabled clipboard history or otherwise changed any of the default clipboard settings?

No.

> Does the issue reproduce when you take the screenshot in such a way that Spectacle's main window shows up instead of a system notification?

I don't know how to test that. But it no longer reproduces in the original way, so if I do that and it doesn't reproduce, that won't tell you much I guess.
Comment 5 Nate Graham 2024-02-07 17:36:19 UTC
Open the app and click on one of the buttons to take a screenshot. If "Quit after save or copy" is checked, uncheck it.

But if you can't reproduce the original issue, then there's less hope of a fix, unfortunately.
Comment 6 Bug Janitor Service 2024-02-22 03:46:12 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 7 php4fan 2024-02-22 11:02:32 UTC
I cannot reproduce as indicated in comment 5, but I can't reproduce systematically in the original way either, so this tells us nothing.

Personally I don't think this has anything to do whatsoever with the notification, but this is just a hunch.

I haven't observed the issue again since the first time.
Comment 8 Noah Davis 2025-02-19 15:26:12 UTC
Is this still an issue for you? I cannot reproduce this in the current version (6.3).
Comment 9 php4fan 2025-02-19 15:59:39 UTC
It was never something that I could systematically reproduce at will to begin with, but anyway I think I've never observed it again after that one tiime.
Comment 10 Bug Janitor Service 2025-03-06 03:47:20 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!