mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-08 02:30:13 +01:00
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>
(cherry picked from commit f59499b5d0)
This commit is contained in:
parent
df12c4daa7
commit
7c859fd5d1
4 changed files with 16 additions and 16 deletions
|
|
@ -1315,13 +1315,9 @@ 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,
|
||||
serverClient, DixSendAccess);
|
||||
rc = dixLookupResourceByType((pointer *) win, listener->listener,
|
||||
listener->resource_type,
|
||||
serverClient, DixSendAccess);
|
||||
if (rc != Success)
|
||||
return FALSE;
|
||||
|
||||
|
|
@ -1462,6 +1458,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
|
|
@ -682,12 +682,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;
|
||||
|
|
@ -748,7 +749,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);
|
||||
}
|
||||
|
||||
|
|
@ -804,7 +806,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;
|
||||
}
|
||||
|
|
@ -819,7 +821,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;
|
||||
|
|
@ -834,7 +836,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;
|
||||
|
|
@ -846,7 +848,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -560,7 +560,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…
Add table
Reference in a new issue