Bug 5327 - Mouse wheel causes pointer grabbing
Summary: Mouse wheel causes pointer grabbing
Status: RESOLVED WONTFIX
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/Core (show other bugs)
Version: 6.8.2
Hardware: All Linux (All)
: low normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-13 09:50 UTC by Deron Johnson
Modified: 2009-09-07 17:18 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Deron Johnson 2005-12-13 09:50:36 UTC
A mouse wheel motion generates two button events, a button press followed
by a button release (button numbers 4 and 5). Because mouse wheel events
are button events they trigger the "default button grab" code located in
events.c:DeliverEventsToWindow. Due to the following code, a mouse wheel
button press events activates a grab and then the following button release
event deactivates it. This constant grabbing and ungrabbing of the pointer 
device happens every time one uses the mouse wheel. This grabbing seems to 
me to be gratuitous.

    if ((type == ButtonPress) && deliveries && (!grab)) 
    {
        <Construct a temporary grab object and activate it>
    }

Suggested fix:

I recommend that this code be modified to ignore mouse wheel ButtonPress
events and not allow them to activate a grab. Here is an example:

    if ((type == ButtonPress) && deliveries && (!grab) && 
         pEvents->u.u.detail < 4)
    {
        ...
    }
Comment 1 Matthias Hopf 2006-01-20 01:39:42 UTC
For the record:

Hard coded button 1-3   (pEvents->u.u.detail < 4)   is clearly wrong (see
discussion on xorg mailing list).
Comment 2 Daniel Stone 2007-02-27 01:29:20 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 3 Peter Hutterer 2009-09-07 17:18:41 UTC
strictly speaking, buttons 4 5 6 7 aren't anything special in the server. They are used as scroll buttons by convention, both in the driver and in the clients. the server doesn't care either way.

the purpose of the implicit passive grab for buttons is to deliver the release event to the same window/client that got the press events - presumably to avoid stuck buttons.

Does activating the grab have a real performance impact here? Seems to me that in most cases that include scrolling the rendering of the application has a higher performance impact than the grab.

I'm closing this as WONTFIX for now. Please feel free to re-open if you think this is a real issue that needs to be addressed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.