Created attachment 122218 [details] foo.c xorg-x11-drv-wacom-0.30.0-3.fc23.x86_64 With the test case included, you'll receive the pad events correctly, but after opening and closing the device (in the "#if 0") you'll stop receiving events.
Original GNOME bug: https://bugzilla.gnome.org/show_bug.cgi?id=763092
Confirmed but after a check of the code this looks to be correct behaviour. From the man page: When a client makes an XCloseDevice request, any active grabs that the client has on the device are released. Any event selections that the client has are deleted, as well as any passive grabs. If the requesting client is the last client accessing the device, the server may disable all access by X to the device. I admit, the crossover between XI1 and XI2 is what's a bit confusing here though and makes this behaviour non-obvious.
(In reply to Peter Hutterer from comment #2) > Confirmed but after a check of the code this looks to be correct behaviour. > From the man page: > > When a client makes an XCloseDevice request, any active grabs > that the client has on the device are released. Any event > selections that the client has are deleted, as well as any > passive grabs. If the requesting client is the last client > accessing the device, the server may disable all access by X to > the device. > > I admit, the crossover between XI1 and XI2 is what's a bit confusing here > though and makes this behaviour non-obvious. It's really not the XI1/XI2 cross-over that makes it weird for me, it's the fact that XIGrabButton() doesn't require opening the device, but will be cancelled if the device is closed for another reason. What would be the work-around? Open the device before XIGrabButton() and close it when ungrabbing (in case another part of g-s-d keeps the device opened)? Find a way to check properties without opening the device?
(In reply to Bastien Nocera from comment #3) <snip> > What would be the work-around? Open the device before XIGrabButton() and > close it when ungrabbing (in case another part of g-s-d keeps the device > opened)? That doesn't work, it ungrabs as soon as you close one of the handles. > Find a way to check properties without opening the device? XIGetProperty() looks like a good way to do it, and that's already the way we check for libinput drivers.
Created attachment 122345 [details] [review] mouse, common: Fix Wacom buttons not receiving events When configuring mice and touchpads, we might stumble upon a Wacom pad device. To check whether it's a synaptics device, we open the device, get the properties, and close it back up. But when we close it, we end up releasing whatever grab the wacom plugin might have had on the pad buttons: When a client makes an XCloseDevice request, any active grabs that the client has on the device are released. Any event selections that the client has are deleted, as well as any passive grabs. If the requesting client is the last client accessing the device, the server may disable all access by X to the device. As we cannot change that behaviour, we'll use a call that doesn't require opening the device so we don't have to close it.
Comment on attachment 122345 [details] [review] mouse, common: Fix Wacom buttons not receiving events Sorry, wrong bug tracker.
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.