Bug 488076 - When focusing a new window, the first attempt to copy something into the clipboard fails
Summary: When focusing a new window, the first attempt to copy something into the clip...
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (show other bugs)
Version: 6.0.5
Platform: NixOS Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-06-05 15:02 UTC by Naxdy
Modified: 2024-06-11 08:13 UTC (History)
1 user (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 Naxdy 2024-06-05 15:02:37 UTC
SUMMARY
Since 6.0.5, after focusing a new window, the first attempt to copy something (e.g. text) into the clipboard fails.

STEPS TO REPRODUCE
1. Open KWrite and Firefox
2. Navigate to a random page in Firefox
3. Focus KWrite
4. Write some text in KWrite, copy it into your clipboard
5. Confirm the text has been copied by pasting it in KWrite
6. Focus Firefox
7. Select & copy some text in Firefox
8. Focus KWrite
9. Attempt to paste text into KWrite

OBSERVED RESULT
The text pasted is the same as the one copied in step (4)

EXPECTED RESULT
The text pasted is the same as the one copied in step (7)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: NixOS Unstable
(available in About System)
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
- This issue was not present in 6.0.4 and earlier version of Plasma 6.
- Hitting Ctrl+C to copy *twice* works around this issue.
- If one were to successfully copy text from Firefox (e.g. by copying "twice") and pasting it into KWrite, the first copy of text from KWrite will fail.
Comment 1 Naxdy 2024-06-05 15:04:12 UTC
Another note: This bug also extends to "click to copy" functionality, e.g. certain buttons on certain websites, and is not limited to Ctrl+C / right click copy.
Comment 2 David Edmundson 2024-06-05 16:45:09 UTC
I cannot reproduce with those steps (6.1 beta),  but we have got scattered reports, so it would be good to chase up

 - Can you see if killing plasmashell (and implicitly klipper) makes a difference?

 - can you run 'WAYLAND_DEBUG=1 kwrite |& grep data'  and 'WAYLAND_DEBUG=1 firefox |& grep data'


and do the steps above
Comment 3 Naxdy 2024-06-05 21:18:15 UTC
Restarting plasmashell using `plasmashell --replace` seems to have fixed the issue for now. I will wait until the problem shows up again, run the two apps with WAYLAND_DEBUG=1 and report back. Moving to plasmashell for now, since it seems to originate there.
Comment 4 Naxdy 2024-06-11 08:13:37 UTC
Since the issue hasn't shown up since, I'm gonna assume this was caused due to something on my end. If, for some reason, it shows up again and is reliably reproducible, I will reopen.