[regression] With slow mice, opening a right-click context menu immediately executes the first entry

Bug #681567 reported by Kateryna Samartseva
94
This bug affects 19 people
Affects Status Importance Assigned to Milestone
gtk+2.0 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Repro steps:

1. Connect a mouse whose button press/release events arrive slowly.
2. Open any gtk app. (For example, gedit or gcalctool.)
3. Right-click somewhere to open a context menu whose first item is selectable. (For example, in gedit just type something and then right-click on the text area--the first item will be Undo and will be selectable. In gcalctool, type in a number, highlight it, and then right-click on the number--the first item will be Cut and will be selectable.)

What I expect to happen:
A context menu should appear and wait for the user to make a selection.

What happens instead:
A context menu appears and disappears and the app immediately executes the first entry without any further clicks. The user doesn't even have enough time to see what has happened. Obviously this is disorientating and annoying.

This is a regression--it used to work fine. I think it started after the update to Maverick.

I believe the problem only occurs with mice that have a large delay between the button press event and the button release event. The built-in trackpad and buttons in my laptop do NOT trigger the problem, but my external mouse does. (The external mouse came with my Wacom Bamboo CTE-450 tablet.) From looking at the timestamps in the "xev" tool, it appears that the external mouse has a much longer delay between the two events than the internal mouse (xev output is attached).

The problem can be avoided in two ways, but neither is convenient:

1) By holding down the right mouse button, moving the mouse over the desired context menu entry, and then releasing the right mouse button.
2) By moving the mouse left and/or up while clicking, so that the mouse button is released quickly but at a different location on screen that is not over the context menu.

Note that slowly moving the mouse to another area of the screen and releasing does NOT work because gtk dismisses the context menu if the button was held down for a certain amount of time before releasing.

The problem only occurs in native gtk apps. Other apps such as Firefox and OpenOffice are not affected.

To solve the problem, I recommend the following:

1) Create the context menu down-and-right of the mouse pointer, so that the mouse pointer is not over the first item when the right mouse button is released.

AND

2) Increase the delay before treating a button release as a distinct event.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: libgtk2.0-0 2.22.0-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-22.35-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic x86_64
Architecture: amd64
Date: Thu Nov 25 12:04:25 2010
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: gtk+2.0

Revision history for this message
Kateryna Samartseva (chibitatto) wrote :
Revision history for this message
Kateryna Samartseva (chibitatto) wrote :
Revision history for this message
Kateryna Samartseva (chibitatto) wrote :
Revision history for this message
Dmitry Alexeyev (dmitry-alx) wrote :

Not sure it's gtk-related.
Also happens on my desktop PC with Ubuntu 10.10
( Linux dmi 2.6.35-27-generic #48-Ubuntu SMP Tue Feb 22 20:25:46 UTC 2011 x86_64 GNU/Linux )
in both gtk and kde/qt applications. Namely it's eclipse, gedit and konsole.
I've got A4tech X7 X-750F mouse connected via USB.
Right-click triggers double-right-click in about 70-80% of clicks.

Just connected my mouse via USB to PS/2 connector, and the bug is gone.

Attaching xev output with both USB and PS/2 logs.

Revision history for this message
Dmitry Alexeyev (dmitry-alx) wrote :

Same mouse, connected via USB to PS/2 connector. Right-click works correctly, no double-click.

Changed in gtk+2.0 (Ubuntu):
status: New → Confirmed
Revision history for this message
demilord (demilord) wrote :

I have the same issue, it happens everywhere.. when i right click desktop it creates a new folder right away...
I keep right mouse button pressed to work around this issue

Bus 002 Device 004: ID 046d:c521 Logitech, Inc. Cordless Mouse Receiver

Revision history for this message
qwerty (matiasjrossi) wrote :

Still happening in an up-to-date Precise install.

I don't think this is a duplicate of #410636. Fixing that bug will act as a workaround for this one, but it looks to me the real issue here is the click and release event being processed as separate actions.

Revision history for this message
elpidio (elpidiovaldez5) wrote :

Any chance it is to do with multithreading ? I am currently using a quadcore and I get the problem. Didn't have it with a single core cpu.

Massively annoying though.

Revision history for this message
Thiago Santos (thiago-igarashi) wrote :

How can I set some delay between right click and the menu context? It is really very annoying
Any Bash Script?

Revision history for this message
oleg978 (ogtewrt642) wrote :

Confirmed on Ubuntu 14.04 amd64. Affected all gtk2, gtk3 and qt application's (gedit, kwrite, firefox, google-chrome, etc) right-click (context) and left-click (main) menus.
Noname USB mouse.

Revision history for this message
Timo Palomaa (timppis) wrote :

Also on 14.04. Started googling for this issue once I noticed in Windows I did not suffer from this issue. Until that point I thought the mouse was just broken (some cheap Logitech mouse with USB bluetooth receiver).

Easy and safe test in gnome-terminal: nearly everytime the mouse moves to right/down direction, either of the first two entries get clicked.

Depressingly old bug report.

Revision history for this message
Timo Palomaa (timppis) wrote :
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.