Bug 420758 - Clipboard and selection synchronization resets selection in GTK apps
Summary: Clipboard and selection synchronization resets selection in GTK apps
Status: RESOLVED DOWNSTREAM
Alias: None
Product: klipper
Classification: Applications
Component: general (show other bugs)
Version: 5.18.4
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-29 15:25 UTC by Lastique
Modified: 2021-03-11 01:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lastique 2020-04-29 15:25:09 UTC
SUMMARY

When Selection and Clipboard synchronization is enabled (i.e. the Ignore selection option is NOT enabled), text selection in GTK (or, possibly, PyGTK) application spuriously gets reset sometimes.

STEPS TO REPRODUCE

1. In the Clipboard widget settings, General tab, make sure "Prevent empty clipboard" is enabled and "Ignore selection" is disabled.
2. Open a GTK application. I use Meld. In it, create a blank text file comparison or initiate comparison of two text files. I've also seen this problem in Sublime Text editor.
3. In the application, select a piece of text with mouse. Try multiple times, if needed.

OBSERVED RESULT

The selection gets reset sometimes. Possibly, this happens when the widget automatically copies the selection to the clipboard.

EXPECTED RESULT

The selection should stay.

SOFTWARE/OS VERSIONS
Linux: Kubuntu 20.04
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION

The workaround is to enable the "Ignore selection" option in the widget settings.
Comment 1 Nate Graham 2021-03-10 22:42:55 UTC
Cannot reproduce with Meld, Gedit, Firefox or Thunderbird. I haven't managed to ever make the selection get reset.

Are you still experiencing this? Is Meld installed from distro packages, out of curiosity, or is it a Flatpak, Snap, or AppImage app?
Comment 2 Lastique 2021-03-11 00:51:33 UTC
(In reply to Nate Graham from comment #1)
> Cannot reproduce with Meld, Gedit, Firefox or Thunderbird. I haven't managed
> to ever make the selection get reset.
> 
> Are you still experiencing this?

Yes, easily reproducible in Meld for me. Freshly booted system, went in Clipboard settings, disabled "Ignore selection", started Meld with blank file diff, typed some text and tried selecting it with mouse.

I suspect that selection clearing on copying to clipboard is a GTK feature/bug, since when "Ignore selection" is enabled and I copy selection with a hotkey (Ctrl+Ins), the selection gets cleared. Happens 100% in Meld. But at least I'm able to select text before the selection is cleared.

> Is Meld installed from distro packages, out
> of curiosity, or is it a Flatpak, Snap, or AppImage app?

Yes, it's installed from Kubuntu .deb packages.

Operating System: Kubuntu 20.10
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2
Kernel Version: 5.8.0-44-lowlatency
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-2600K CPU @ 3.40GHz
Memory: 15.6 GiB of RAM
Graphics Processor: GeForce RTX 2080 Ti/PCIe/SSE2
Comment 3 Nate Graham 2021-03-11 01:04:25 UTC
Weird. I just tried again with a blank diff, copying the text with Ctrl+Ins just like you said, and the text is not cleared.

Regardless, nothing in Klipper itself or any KDE software is capable of clearing text in a GTK app, so I would recommend following up with Meld developers, or perhaps the GTK developers of nothing bears fruit over there. At this point I suspect  a bug in Meld, which is going to be a somewhat old version at this point. It's possible it's been fixed in a newer one.

Thanks for the info!