summaryrefslogtreecommitdiff
path: root/dix/touch.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-10-30 12:44:08 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-01-09 12:33:36 +1000
commitf59499b5d05fde83813709e9848152951592120d (patch)
tree40e847c4aeef9d58c0d71a7c8ab78bbf7a1ad72a /dix/touch.c
parent9ad0fdb135a1c336771aee1f6eab75a6ad874aff (diff)
dix: add resource type to touch listeners
Instead of guessing what resource type the listener is and what property to retrieve, store the resource type in the listener directly. Breaks XIT test cases: TouchGrabTestMultipleTaps.PassiveGrabPointerEmulationMultipleTouchesFastSuccession Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56557 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com>
Diffstat (limited to 'dix/touch.c')
-rw-r--r--dix/touch.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/dix/touch.c b/dix/touch.c
index 99f105b2e..0db842c65 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -675,12 +675,13 @@ TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource)
* Add the resource to this touch's listeners.
*/
void
-TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
- enum TouchListenerType type, enum TouchListenerState state,
- WindowPtr window,
+TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type,
+ enum InputLevel level, enum TouchListenerType type,
+ enum TouchListenerState state, WindowPtr window,
GrabPtr grab)
{
ti->listeners[ti->num_listeners].listener = resource;
+ ti->listeners[ti->num_listeners].resource_type = resource_type;
ti->listeners[ti->num_listeners].level = level;
ti->listeners[ti->num_listeners].state = state;
ti->listeners[ti->num_listeners].type = type;
@@ -741,7 +742,8 @@ TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
type = LISTENER_POINTER_GRAB;
}
- TouchAddListener(ti, grab->resource, grab->grabtype,
+ /* grab listeners are always RT_NONE since we keep the grab pointer */
+ TouchAddListener(ti, grab->resource, RT_NONE, grab->grabtype,
type, LISTENER_AWAITING_BEGIN, grab->window, grab);
}
@@ -797,7 +799,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (!xi2mask_isset(iclients->xi2mask, dev, XI_TouchOwnership))
TouchEventHistoryAllocate(ti);
- TouchAddListener(ti, iclients->resource, XI2,
+ TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI2,
type, LISTENER_AWAITING_BEGIN, win, NULL);
return TRUE;
}
@@ -812,7 +814,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
continue;
TouchEventHistoryAllocate(ti);
- TouchAddListener(ti, iclients->resource, XI,
+ TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI,
LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
win, NULL);
return TRUE;
@@ -827,7 +829,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
/* window owner */
if (IsMaster(dev) && (win->eventMask & core_filter)) {
TouchEventHistoryAllocate(ti);
- TouchAddListener(ti, win->drawable.id, CORE,
+ TouchAddListener(ti, win->drawable.id, RT_WINDOW, CORE,
LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
win, NULL);
return TRUE;
@@ -839,7 +841,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
continue;
TouchEventHistoryAllocate(ti);
- TouchAddListener(ti, oclients->resource, CORE,
+ TouchAddListener(ti, oclients->resource, RT_OTHERCLIENT, CORE,
type, LISTENER_AWAITING_BEGIN, win, NULL);
return TRUE;
}