Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middle-clicking twice quickly, results in text pasted 3 times instead of 2 #925

Open
DrLex0 opened this issue Jun 21, 2024 · 3 comments
Open

Comments

@DrLex0
Copy link

DrLex0 commented Jun 21, 2024

Describe the bug
Middle-clicking twice in quick succession, will paste text 3 times instead of the expected 2 times. It's on the second click that the text is pasted one time too many, resulting in a total of 3 pastings.
It also happens when pressing a key in between the 2 clicks.
Happens in every system I have tried, including VMs, with every mouse I have tried, also emulated mouse in VMs. So please don't tell me it's bad debouncing or whatever, it is not.
I suspect the time threshold for the bug to occur might coincide with the double-click threshold.

To Reproduce
Select some text and then middle-click twice inside a Terminator window, with very little time in between.

Expected behavior
Text is pasted twice, once of each click.

Desktop (please complete the following information):

  • OS or Linux Distribution: Ubuntu
  • Version: 22.04 (Jammy), already present in Bionic and probably earlier. Terminator version 2.1.1-1
  • Display Technology: X11

Additional context
I won't even tell how much time I have wasted on this, by thinking the mouse was at fault, and then replacing mice or trying to clean the switch with contact cleaner. Please fix this.

@mattrose
Copy link
Member

Can confirm. It even happens with 2.1.4 on Ubuntu 22.04.

Never noticed this before, sorry it's been driving you nuts.

Having said that, it might be tricky to track down what's causing it, but I'll take a look

@egmontkob
Copy link

egmontkob commented Jun 21, 2024

My first thought was that it's handled entirely by VTE, isn't it? However, other VTE+GTK3-based terminals don't suffer from this issue.

Yet VTE+GTK4-based ones that I could try quickly (i.e. kgx and blackbox) do suffer from a similar problem in the opposite direction: the text isn't pasted on the second or third click. (Update: just filed https://gitlab.gnome.org/GNOME/vte/-/issues/2790 for this.)

(Double and triple clicks are handled differently in GTK3 vs. GTK4: https://gitlab.gnome.org/GNOME/vte/-/issues/2648)

Anyway, I still think it could be partially VTE's fault, dunno.

@mattrose
Copy link
Member

I suspect it's something in the way that we handle the middle-mouse clicks. there's so much special case code around copying and pasting that I wouldn't be suprised if we were doing something unusual there. It's probably that, combined with a VTE problem 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants