Inconsistency between xinput2 and xkb on button release.
Philippe-A. Lemelin
philippe.lemelin at extenway.com
Tue Jan 13 16:05:47 PST 2015
Good evening,
We have stumbled across what seems like an inconsistency on how button
release events are delivered when xinput2 is used instead of xkb.
We saw the issue on some flash content under Firefox. When touching the
screen the ButtonRelease would never be sent to Firefox (observed with
xtrace). In that case, it was observed with at multi-touch touchscreen
and the events would be touch events (RawTouchBegin, RawTouchEnd).
The same flash content would work just fine on a simple touchscreen that
would report simple ButtonPress and ButtonRelease. When launching
Firefox under xtrace and following the execution with GDB, we would
observed the following on the functional touch screen:
A XUngrabPointer from Firefox
The ButtonRelease sent to Firefox.
With xinput2, the ButtonRelease was never sent to Firefox. It was always
"eaten" in xevents because "the grab was not the active". This is where
the behavior is inconsistent.
We applied the following patch:
diff -Naur xorg-server-1.15.1_original/Xi/exevents.c
xorg-server-1.15.1_new/Xi/exevents.c
--- xorg-server-1.15.1_original/Xi/exevents.c 2015-01-13
19:00:39.698254270 -0500
+++ xorg-server-1.15.1_new/Xi/exevents.c 2015-01-13 18:58:18.722763486 -0500
@@ -1393,9 +1393,12 @@
int deliveries = 0;
/* 'grab' is the passive grab, but if the grab isn't active,
- * * don't deliver */
- if (!dev->deviceGrab.grab)
- return !Success;
+ * deliver to the window under the pointer */
+ if (!dev->deviceGrab.grab) {
+ DeliverDeviceEvents(GetSpriteWindow(dev), ptrev,
+ NullGrab, NullWindow, dev);
+ return Success;
+ }
if (grab->ownerEvents) {
WindowPtr focus = NullWindow;
Finally, what stumped us for a while was the behavior under a clean
Ubuntu 14.04 installation. The ButtonRelease was received by Firefox.
For some reason, with compiz, the timestamp for the XUngrabPointer is
invalid and that gets discarded and the ButtonRelease is delivered in
that case. Using Icewm under Ubuntu 14.04 left us with the same behavior
where the ButtonRelease was not delivered....
Any feedback is appreciated.
Best regards,
--
Philippe-A. Lemelin
More information about the xorg-devel
mailing list