Bug 59100 - Stuck button if DGA activates during grab
Summary: Stuck button if DGA activates during grab
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/Core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-07 05:35 UTC by Peter Hutterer
Modified: 2013-01-21 01:22 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
test program to reproduce (2.10 KB, text/plain)
2013-01-07 05:35 UTC, Peter Hutterer
no flags Details

Description Peter Hutterer 2013-01-07 05:35:00 UTC
Created attachment 72611 [details]
test program to reproduce

If DGA input is activated while a passive grab is active, the release event is lost and the master is left with a stuck button.

http://lists.x.org/archives/xorg-devel/2012-August/033310.html

Analysis copied from the thread above:

DGAProcessPointerEvent() calls UpdateDeviceState() with mouse
button events where ev.detail.key is not set.

As for the slave device, that's a race condition. UDS doesn't get called
for slave devices at all while a DGA handler is active (note that the DGA
extension does not support per-device flags, it only works on masters
anyway).

So the net result is here that the slave device never has any button state
modified, and this should largely be fine. that is, unless you hit the
race condition that MCedit appears to trigger. If you call XDGASetMode()
after receiving a ButtonPress event (and that request gets processed before
the release event), the release event never updates the state of the slave
device, leading to the stuck button.
Comment 2 Peter Hutterer 2013-01-21 01:22:27 UTC
commit ad3bc571348a7007a2960bf87ae739397c5511ee
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jan 8 11:19:09 2013 +1000

    xfree86: update the device state for all DGA events (#59100)

commit c5f2818edbec2f87383baa6c6be5c389b73ca6f9
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jan 8 10:13:53 2013 +1000

    xfree86: set event->detail for DGA pointer events


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.