Bug 498914 - Only second item copied will get copied to clipboard
Summary: Only second item copied will get copied to clipboard
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (show other bugs)
Version: 6.2.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-20 04:55 UTC by Irfan
Modified: 2025-01-23 05:24 UTC (History)
2 users (show)

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


Attachments
Screen recording of KDE's Kate app trying to demonstrate an annoying issue where copy+paste only works reliably when copying is done twice. (3.73 MB, video/mp4)
2025-01-20 04:55 UTC, Irfan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Irfan 2025-01-20 04:55:29 UTC
Created attachment 177541 [details]
Screen recording of KDE's Kate app trying to demonstrate an annoying issue where copy+paste only works reliably when copying is done twice.

SUMMARY


STEPS TO REPRODUCE
1. Paste somewhere, anywhere i.e. on Kate just to see what's the current item on your clipboard.
2. Copy (or Cut) a new thing to clipboard **once** - the action to copy could be through a keybind (i.e. `Ctrl + C`), a context menu, or click-to-copy operations such as in KDE's Emoji Selector or any website on a browser like Firefox. What you copy could also be anything, it could be text, or could be a file on Dolphin.
3. Paste anywhere on the same app or a different app.

EXPECTED RESULT
What gets pasted should be what you had just copied or cut to your clipboard in step 2.

OBSERVED RESULT
What gets pasted will be what you had in your clipboard in step 1. To achieve the expected result when this bug occurs, you need to actually perform step 2 **TWICE**, rather than once.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.6.70-1-lts (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2
Manufacturer: ASUS

ADDITIONAL INFORMATION
I did not have this issue yesterday or earlier today (on the same login session), and nothing (obvious) could be the trigger (i.e. not recently updated or restarted the system before experiencing this, or installed/uninstalled anything, restarted any services, configured any settings, etc.)

I'm almost certain though, that if I restart my system now, that this issue will be "fixed" - so I'm trying to avoid that until I receive advice on how to find what's causing this or how to fix it. I have attached a video to demonstrate this happening on Kate, but as I have described on how to reproduce the issue, it happens on pretty much anywhere and not only with text-based clipboard content such as on a browser like Firefox, terminals like Konsole and Alacritty, text editors like Kate and Visual Studio Code, and even file managers like Dolphin.
Comment 1 duha.bugs 2025-01-20 23:41:56 UTC
Possibly related to https://bugs.kde.org/show_bug.cgi?id=498341
Comment 2 Nate Graham 2025-01-21 23:08:35 UTC
Are you using any non-default clipboard settings?

After you copy something and notice it's not paste-able, please press Meta+V to see if it made it into the clipboard.

Basically the question is whether it fails to copy, or fails to paste.
Comment 3 Irfan 2025-01-22 04:34:32 UTC
(In reply to Nate Graham from comment #2)
> Are you using any non-default clipboard settings?

Both times when it was working 99.9% of the time, and the 0.1% like this time when it's not, I believe the only changes made (based on cross matching with the "Defaults") are:

- History size: from `20` entries to `100`
- Non-text selection: from `Never save in history` to `Only when explicitly copied`

> After you copy something and notice it's not paste-able, please press Meta+V
> to see if it made it into the clipboard.

I unfortunately did not check this, but I assume it did not make it into the clipboard only because it was pasting something, and I assume how pasting works is that it would paste what's latest in the clipboard - just the latest happens to be not the very latest item I had copied but the one before it.

Another thing worth mentioning is that when I tested it, I noticed that it's not that I have to copy a specific item (i.e. `A`) twice to have it copied (or rather, paste the right thing), that item just has to be the second thing I copied.

For example, if I want to (copy and) paste item `A`, I don't _necessarily_ need to copy item `A` twice, I can alternatively also copy item `B` (once) **THEN** copy item `A` once, and when I paste it - it will be item `A`. So based on my video demo, why the "copy twice then paste" workaround works isn't necessarily because it was copied twice, it just needed to be copied during the second-turn intervals.

Beyond this observation, I'm now unable to verify or test anything else as just like how it started happening with seemingly no obvious trigger, the issue also suddenly disappeared a few hours after I made the bug report with seemingly no trigger whatsoever, as I purposefully left the desktop untouched other than doing my regular work of writing code, internet browsing, etc. in hopes of _living_ with the issue until I get advice on how to hunt this bug.
Comment 4 Nate Graham 2025-01-22 22:16:05 UTC
Thanks. I actually use nearly the same settings, and haven't seen this in git master.

Issues that appear only sporadically like this are unfortunately almost impossible to debug. :( For now the best I can say is that we've made a bunch of clipboard robustness fixes in Plasma 6.3, which is being released in a couple weeks, so let's see if any of them fix the issue for you. If not, please feel free to re-open this.
Comment 5 Irfan 2025-01-23 02:47:15 UTC
(In reply to Nate Graham from comment #4)
> Thanks. I actually use nearly the same settings, and haven't seen this in
> git master.
> 
> Issues that appear only sporadically like this are unfortunately almost
> impossible to debug. :( For now the best I can say is that we've made a
> bunch of clipboard robustness fixes in Plasma 6.3, which is being released
> in a couple weeks, so let's see if any of them fix the issue for you. If
> not, please feel free to re-open this.

Totally understandable and I'm more than happy with this resolution. Looking forward to Plasma 6.3, thank you!
Comment 6 Nate Graham 2025-01-23 05:24:09 UTC
You're welcome!