Bug 440617 - Copy/Paste will randomly not work
Summary: Copy/Paste will randomly not work
Status: RESOLVED NOT A BUG
Alias: None
Product: plasmashell
Classification: Plasma
Component: Clipboard widget & pop-up (show other bugs)
Version: 5.22.4
Platform: unspecified Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-05 01:20 UTC by and_s52
Modified: 2021-08-06 23:00 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 and_s52 2021-08-05 01:20:04 UTC
SUMMARY
Some variations of this bug seem to have been reported some years ago. In KDE, copy paste seems to not work occasionally. This is happening in X, unlike some previous bug reports which indicated the bug was only on Wayland.

Sometimes, the copy to clipboard function will simply not work (either my mouse clicking or keyboard Ctr+C). This behaviour seems to be random and there seems to be no correlation between GTK or Qt apps. Repeating the copy to clipboard some times will eventually copy the intended element but this is very annoying. If anything, I noticed this happens more between different programs rather than between the same program, but I might be wrong.

STEPS TO REPRODUCE
Due to the randomness of this bug, its not exactly clear how to reproduce.
1. Copy an element to clipboard
2. Paste somewhere else

OBSERVED RESULT
Any item should be copied after the first copy has been issued, either by mouse or keyboard.

EXPECTED RESULT
Sometimes, pasting will either pasting the previously copied element or nothing at all, if no previous element was present on the clipboard, indicating that the copy didn't work.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux 5.13.6-arch1-1
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Not much I can add, this is a really random and difficult to reproduce bug. I asked in Reddit and some people report the same. Reddit link: https://www.reddit.com/r/kde/comments/oxww24/kde_copy_paste_still_broken/
Comment 1 and_s52 2021-08-05 01:21:46 UTC
I swapped the OBSERVED RESULT with EXPECTED RESULT by accident. I can't seem to edit the original text.
Comment 2 David Edmundson 2021-08-05 09:39:10 UTC
On X11 KDE is not involved anywhere copying and pasting between clients.

The only thing that can meddle with this is klipper - our clipboard manager. 

Please can you try disabling this (remove the applet) and confirm if this changes things.
Comment 3 and_s52 2021-08-06 07:08:07 UTC
Ok. I managed to narrow down when the bug happens. Basically, in the reddit post, I was told this is related to an X bug that causes the clipboard to be emptied if the source application is closed. This bug indeed only seems to happen when closing a program and pasting some content from it afterwards.

But this is only happening in a very peculiar situation. I hid the clipboard manager applet from the tray "Deactivated". This is the only time the bug happens. If the applet is visible or just collapsed into the tray list, the bug doesn't occur. So its actually disabling klipper that causes the bug.

This is very annoying as this means I am forced to have an applet that leaks everything I have been copying and pasting when I absolutely do not want this feature. Also, when changing options in the applet, the KDE shell crashed sometimes, so clearly the applet is very unstable.
Comment 4 David Edmundson 2021-08-06 07:38:13 UTC
If you want contents to persist after an app is closed you will need to use klipper.
Comment 5 and_s52 2021-08-06 07:53:40 UTC
But technically this is an X bug then isnt it? And klipper is solving it?

And since I cannot disable klipper, how do I disable the paste history thing?
Comment 6 David Edmundson 2021-08-06 08:09:12 UTC
>But technically this is an X bug then isnt it? And klipper is solving it?

Not really a bug, it is expected X behaviour that closing an application means you can't copy from it. The real data copying only actually happens when you paste.

Klipper resolves this by constantly copying any new text into a history so that we always have the contents. So you need the history in order for it to work. You can reduce the number of items stored.
Comment 7 and_s52 2021-08-06 22:45:47 UTC
I am very sorry then for assuming this was a bug all along. I had no idea Klipper could have its history reduced. Doing that fixes all my problems. 

I just want to thank you a lot for your time and I deeply apologize opening a bug report for a non bug. Thanks a lot for all the feedback!
Comment 8 David Edmundson 2021-08-06 23:00:26 UTC
no problem