Primary selection from certain applications ignored

Bug #1955662 reported by Lithopsian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Diodon
Triaged
Medium
Unassigned

Bug Description

When text is selected in certain applications, Diodon does not show it in the history and will not remember it after the application is closed. Two examples are geany and devhelp. The common trend appears to be that these applications update the primary clipboard continuously during the selection of items, but not at the end of the selection when the mouse button or shift key is released.

Revision history for this message
Oliver Sauder (sao) wrote :

Thanks for reporting. I have done some testing and can confirm what you discovered. I used devhelp for testing. At the end of the selection there is no change of owner of the primary clipboard and therefore Diodon does not add anything to the history.

I quickly tested disabling the Diodon check whether buttons are released before adding anything to the clipboard history. It turns out in such a case the history gets flooded with entries, every so little move with the mouse adds a new item.

So not so sure what to do about this. Is this a bug in Diodon or in the respective application? And if it is in Diodon what are possible fixes without flooding the clipboard history?

Ideas are welcome.

Changed in diodon:
status: New → Confirmed
Revision history for this message
Lithopsian (x-uzuntu-c) wrote :

Given that multiple applications seem to work this way, I think it would be preferable to handle it somehow. I can think of at least a couple of ways of working with this approach.

One way would be to keep kicking the can down the road when events are received with the shift or mouse button down. Only the final selection would then be processed inside Diodon. A fairly rapid timer could be used, probably only the first time an event is received with the selection still in progress or it could snowball, then cancelled when the selection is finally complete and has been processed by Diodon. Maybe not elegant, but should be a fairly simple solution.

Another approach is to process the selection for each event, but track when it appears to be an incremental enlargement of the previous one. Might need to track incremental reduction in selections also. Incremental might involve quite big changes, such as a whole new line being added to the selection, but I think it should still be practical. I know that gpaste does this because it has a specific option to enable it, but I'm not sure how bulletproof it is because that's not a clipboard manager that I use in real life. Looks like it can still produce a whole stream of steadily-smaller selections in some situations.

Revision history for this message
Oliver Sauder (sao) wrote :

Thanks for the suggestions.

The second suggestion I think won't work properly because it is easy to decrease a selection as well or change it altogether. For example using the keyboard I select with the key down but then decide to go upwards. With the mouse even crazier selection can be done.

Your first suggestion I find interesting though and I think might be worth to explore to see how well it works in practice.

Any PR is very welcome at https://github.com/diodon-dev/diodon

Changed in diodon:
status: Confirmed → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.