summaryrefslogtreecommitdiff
path: root/Xi/exevents.c
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2013-11-21 21:24:20 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2013-12-11 14:00:50 +1000
commitc1d30b5bd7f90e68bc38404fd0cc32578d6d3018 (patch)
treea8abec73d4b5838ffc64ae8e5f428327eb012502 /Xi/exevents.c
parentb3533d0b212b6747a8f9a01931253d6bdb648ee2 (diff)
Xi: Don't ActivateEarlyAccept POINTER_REGULAR listeners
Bug #71878 describes a bug resulting in the server ceasing to respond to keyboard input after a touch event. The problem might be the following: DeliverTouchBeginEvent tries to deliver an event to a listener of type LISTENER_POINTER_REGULAR, taking the following if branch, if (listener->type == LISTENER_POINTER_REGULAR || listener->type == LISTENER_POINTER_GRAB) { rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab, xi2mask); if (rc == Success) { listener->state = LISTENER_IS_OWNER; /* async grabs cannot replay, so automatically accept this touch */ if (dev->deviceGrab.grab && dev->deviceGrab.fromPassiveGrab && dev->deviceGrab.grab->pointerMode == GrabModeAsync) ActivateEarlyAccept(dev, ti); } goto out; } DeliverTouchEmulatedEvent succeeds. The deviceGrab meets all three of the conditions of the inner if, enters ActivateEarlyAccept which then fails due to, BUG_RETURN(ti->listeners[0].type != LISTENER_GRAB && ti->listeners[0].type != LISTENER_POINTER_GRAB); That is, despite listener->type == LISTENER_POINTER_REGULAR. With my non-existent knowledge of XINPUT, it seems like the solution here might be to only ActivateEarlyAccept when listener->type == LISTENER_POINTER_GRAB. Signed-off-by: Ben Gamari <bgamari.foss@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi/exevents.c')
-rw-r--r--Xi/exevents.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 5dc902054..5e1d3e0a6 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1845,7 +1845,8 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (rc == Success) {
listener->state = LISTENER_IS_OWNER;
/* async grabs cannot replay, so automatically accept this touch */
- if (dev->deviceGrab.grab &&
+ if (listener->type == LISTENER_POINTER_GRAB &&
+ dev->deviceGrab.grab &&
dev->deviceGrab.fromPassiveGrab &&
dev->deviceGrab.grab->pointerMode == GrabModeAsync)
ActivateEarlyAccept(dev, ti);