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>
This commit is contained in:
parent
9ad0fdb135
commit
f59499b5d0
|
@ -1305,12 +1305,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
*mask = (*grab)->xi2mask;
|
||||
}
|
||||
else {
|
||||
if (listener->level == CORE)
|
||||
rc = dixLookupWindow(win, listener->listener,
|
||||
serverClient, DixSendAccess);
|
||||
else
|
||||
rc = dixLookupResourceByType((pointer *) win, listener->listener,
|
||||
RT_INPUTCLIENT,
|
||||
listener->resource_type,
|
||||
serverClient, DixSendAccess);
|
||||
if (rc != Success)
|
||||
return FALSE;
|
||||
|
@ -1452,6 +1448,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
l = &ti->listeners[ti->num_listeners - 1];
|
||||
l->listener = devgrab->resource;
|
||||
l->grab = devgrab;
|
||||
//l->resource_type = RT_NONE;
|
||||
|
||||
if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
|
||||
l->type = LISTENER_POINTER_GRAB;
|
||||
|
|
18
dix/touch.c
18
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;
|
||||
}
|
||||
|
|
|
@ -565,7 +565,7 @@ extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
|
|||
extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev,
|
||||
XID resource);
|
||||
extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
|
||||
extern void TouchAddListener(TouchPointInfoPtr ti, XID resource,
|
||||
extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type,
|
||||
enum InputLevel level, enum TouchListenerType type,
|
||||
enum TouchListenerState state, WindowPtr window, GrabPtr grab);
|
||||
extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
|
||||
|
|
|
@ -301,6 +301,7 @@ typedef struct _ValuatorClassRec {
|
|||
typedef struct _TouchListener {
|
||||
XID listener; /* grabs/event selection IDs receiving
|
||||
* events for this touch */
|
||||
int resource_type; /* listener's resource type */
|
||||
enum TouchListenerType type;
|
||||
enum TouchListenerState state;
|
||||
enum InputLevel level; /* matters only for emulating touches */
|
||||
|
|
Loading…
Reference in New Issue