Bug 498894

Summary: With "Keep the selection and clipboard the same" option, in some apps the text selection is inappropriately added to the clipboard history *while still dragging*
Product: [Plasma] plasmashell Reporter: bugs
Component: Clipboard widget & pop-upAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: duha.bugs, fanzhuyifan, kdedev, mariothrowsfireball, nate, ricsan, seleko, tomashnyk
Priority: NOR Keywords: wayland-only
Version First Reported In: 6.2.4   
Target Milestone: 1.0   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Multiple selection from a text paragraph
Klipper options (for completeness)

Description bugs 2025-01-19 18:46:12 UTC
Created attachment 177531 [details]
Multiple selection from a text paragraph

I'm creating this report in the general product, since I cannot find the Klipper app anywhere in the Bugzilla KDE tracker.

SUMMARY
When the "Text selection -> Always save in history" option is selected in Klipper general configuration, when I select any text using the mouse, Klipper save all possible text selections character by character (I have attached a screenshort showing this). Instead, a single text selection should be saved only after releasing the left mouse button.

STEPS TO REPRODUCE
1. Configure Clipboard...
2. Select the Always save in history option in Text selection
3. Using the mouse, press and hold the left click, select a text paragraph and release the left button.
4. Left click on Klipper, you see all text entries starting from the first character in the selected text until the last one, instead of one whole text selection.

OBSERVED RESULT
Multiple text selections that are as many as the count of characters selected.

EXPECTED RESULT
One single text selection that contains the whole text from the mouse selection. The text should be selected as a single entry only after releasing the left mouse button.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.12.10 (x86_64)
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.1
Comment 1 Nate Graham 2025-01-21 21:00:29 UTC
That is very strange; I cannot confirm it with those settings.

Is this on Wayland or X11, or both?
Comment 2 bugs 2025-01-22 14:00:55 UTC
(In reply to Nate Graham from comment #1)
> That is very strange; I cannot confirm it with those settings.
> 
> Is this on Wayland or X11, or both?

Wayland. I haven't tried it on X11, I will though just for completeness.
Comment 3 bugs 2025-01-22 20:49:55 UTC
This is only Wayland specific. Inside a X11 session, the copied text appears only once. I've just tested it.
Comment 4 fanzhuyifan 2025-01-23 17:17:30 UTC
Cannot reproduce on git build, wayland, arch linux. Does this only happen when selecting from specific apps, or does it happen with all the apps you use?
Comment 5 bugs 2025-01-23 17:27:33 UTC
Created attachment 177629 [details]
Klipper options (for completeness)

I've attached the Klipper options as I have them in my system, just for accuracy.
Comment 6 bugs 2025-01-23 17:38:23 UTC
I found this thread in the Manjaro forum that describes the same issue as mine: https://forum.manjaro.org/t/newly-copied-text-placed-in-2nd-position-of-clipboard/167525/3
Comment 7 duha.bugs 2025-01-23 20:25:47 UTC
Can be reproduced with:
Vivaldi (Xwayland)
Vivaldi (Wayland)
Steam client
NVIDIA X Server Settings
Parabolic (GTK)

Can not be reproduced with:

Firefox(Xwayland)
Firefox (Wayland)
KWrite, 
NeoChat
Parabolic (QT)
Comment 8 Nate Graham 2025-01-27 21:57:21 UTC
Oh my goodness, I can reproduce this now with Steam. The key is to use the "Keep the selection and clipboard the same" option.

It's possible it's happening under the hood even with that option off, and you just don't notice it since all the selections don't become visible in the UI anywhere.
Comment 9 tomashnyk 2025-08-02 11:43:03 UTC
This sounds like https://bugs.kde.org/show_bug.cgi?id=458428 which is in turn probably a duplicate of https://bugs.kde.org/show_bug.cgi?id=482056 which is closed as an upstream chromium bug: https://issues.chromium.org/issues/329330874

I confirm NVIDIA X Server Settings triggers this bug (I think it is a GTK app), Parabolic does not (but I think I probably installed QT version, not sure how to get GTK). Transmission QT is fine, Transmission GTK has the bug. So I think the bug is present for:
Chromium things
GTK applications
Steam Client (which uses some weird proprietary toolkit, if I got it correctly)

I tried to install Parcellite (another clipboard manager) though and it does not display the same bug at all, so this can be solved on a clipboard manager side. I guess parcellite maybe compares the last entry with the new entry and if they are the same and the time between them is very small, it just overwrites the old entry? (I guess I will go back to using Parcellite untill this is fixed, this bug is very annoying :-()
Comment 10 tomashnyk 2025-09-18 11:07:29 UTC
*** Bug 458428 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2025-10-01 17:01:42 UTC
*** Bug 509265 has been marked as a duplicate of this bug. ***