Bug 462338 - Selecting text copies to clipboard twice with double-click
Summary: Selecting text copies to clipboard twice with double-click
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: copy-paste (show other bugs)
Version: 22.08.3
Platform: unspecified Linux
: NOR minor
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-28 03:44 UTC by Roy Orbitson
Modified: 2023-02-01 12:18 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 Roy Orbitson 2022-11-28 03:44:19 UTC
SUMMARY
With *Copy on select* enabled in one's Konsole profile, unnecessary extra entries are created in clipboard history when beginning a selection with a double-click.

STEPS TO REPRODUCE
1. Ensure the above feature is enabled in the profile's mouse settings.
2. Display two or more "words" in any terminal program separated by spaces, e.g. just typing words in your shell.
3. Select, avoiding mouse-aware program detection, by holding Shift and double-clicking the first word, but without releasing the mouse button. Drag to extend the selection to adjacent words then release the mouse button and Shift.
4. Inspect the clipboard history in Klipper.

OBSERVED RESULT
Two new entries are added: the final selection, and the word under where selection began.

EXPECTED RESULT
Only one new entry, the final selection, should be added, based on when the mouse button was released.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.10
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.6
Comment 1 Bug Janitor Service 2022-12-01 01:20:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/777
Comment 2 Kurt Hindenburg 2022-12-18 23:38:05 UTC
Git commit f68f7f7cffb13fdf71a352c45e9c2f07ae11b26b by Kurt Hindenburg, on behalf of Luis Javier Merino Morán.
Committed on 18/12/2022 at 22:58.
Pushed by hindenburg into branch 'master'.

Only set X11 selection on mouse release

Since the beginning of time, konsole has been setting the X11 selection
on mouse release, on double click, and on triple click.  This results in
intermediate entries being created on klipper, e.g. for double click you
get the initial word, and the final selection when you eventually
release the mouse button.

Note we still will get an intermediate entry on triple click (double
click release), but we still prevent one intermediate entry (triple
click entry) on that case.

M  +5    -5    src/terminalDisplay/TerminalDisplay.cpp
M  +1    -1    src/terminalDisplay/TerminalDisplay.h

https://invent.kde.org/utilities/konsole/commit/f68f7f7cffb13fdf71a352c45e9c2f07ae11b26b
Comment 3 Josh Taylor 2023-01-17 13:51:05 UTC
Hi

The problem with this is that middle click no longer copies the selection, resulting in a weirdness of copy/pasting.

I'm not sure how to describe it in words, but the copying seems to be behind a click or two when using middle mouse button?

https://i.imgur.com/ZMRB2fh.gif

I figured out what's causing it - https://invent.kde.org/utilities/konsole/-/merge_requests/805
Comment 4 Bug Janitor Service 2023-02-01 12:18:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/808