dix: Rename LISTENER_* to TOUCH_LISTENER_*

This commit is contained in:
Povilas Kanapickas 2020-10-10 02:51:35 +03:00 committed by Peter Hutterer
parent f6e0bf6833
commit 8bd8b3af19
4 changed files with 78 additions and 75 deletions

View File

@ -1043,8 +1043,8 @@ ActivateEarlyAccept(DeviceIntPtr dev, TouchPointInfoPtr ti)
XID error; XID error;
GrabPtr grab = ti->listeners[0].grab; GrabPtr grab = ti->listeners[0].grab;
BUG_RETURN(ti->listeners[0].type != LISTENER_GRAB && BUG_RETURN(ti->listeners[0].type != TOUCH_LISTENER_GRAB &&
ti->listeners[0].type != LISTENER_POINTER_GRAB); ti->listeners[0].type != TOUCH_LISTENER_POINTER_GRAB);
BUG_RETURN(!grab); BUG_RETURN(!grab);
client = rClient(grab); client = rClient(grab);
@ -1077,8 +1077,8 @@ FindOldestPointerEmulatedTouch(DeviceIntPtr dev)
continue; continue;
for (j = 0; j < ti->num_listeners; j++) { for (j = 0; j < ti->num_listeners; j++) {
if (ti->listeners[j].type == LISTENER_POINTER_GRAB || if (ti->listeners[j].type == TOUCH_LISTENER_POINTER_GRAB ||
ti->listeners[j].type == LISTENER_POINTER_REGULAR) ti->listeners[j].type == TOUCH_LISTENER_POINTER_REGULAR)
break; break;
} }
if (j == ti->num_listeners) if (j == ti->num_listeners)
@ -1105,17 +1105,17 @@ TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
TouchOwnershipEvent *ev) TouchOwnershipEvent *ev)
{ {
TouchListener *listener = &ti->listeners[0]; /* new owner */ TouchListener *listener = &ti->listeners[0]; /* new owner */
int accepted_early = listener->state == LISTENER_EARLY_ACCEPT; int accepted_early = listener->state == TOUCH_LISTENER_EARLY_ACCEPT;
/* Deliver the ownership */ /* Deliver the ownership */
if (listener->state == LISTENER_AWAITING_OWNER || accepted_early) if (listener->state == TOUCH_LISTENER_AWAITING_OWNER || accepted_early)
DeliverTouchEvents(dev, ti, (InternalEvent *) ev, DeliverTouchEvents(dev, ti, (InternalEvent *) ev,
listener->listener); listener->listener);
else if (listener->state == LISTENER_AWAITING_BEGIN) { else if (listener->state == TOUCH_LISTENER_AWAITING_BEGIN) {
/* We can't punt to a pointer listener unless all older pointer /* We can't punt to a pointer listener unless all older pointer
* emulated touches have been seen already. */ * emulated touches have been seen already. */
if ((listener->type == LISTENER_POINTER_GRAB || if ((listener->type == TOUCH_LISTENER_POINTER_GRAB ||
listener->type == LISTENER_POINTER_REGULAR) && listener->type == TOUCH_LISTENER_POINTER_REGULAR) &&
ti != FindOldestPointerEmulatedTouch(dev)) ti != FindOldestPointerEmulatedTouch(dev))
return; return;
@ -1158,7 +1158,7 @@ CheckOldestTouch(DeviceIntPtr dev)
{ {
TouchPointInfoPtr oldest = FindOldestPointerEmulatedTouch(dev); TouchPointInfoPtr oldest = FindOldestPointerEmulatedTouch(dev);
if (oldest && oldest->listeners[0].state == LISTENER_AWAITING_BEGIN) if (oldest && oldest->listeners[0].state == TOUCH_LISTENER_AWAITING_BEGIN)
TouchPuntToNextOwner(dev, oldest, NULL); TouchPuntToNextOwner(dev, oldest, NULL);
} }
@ -1182,7 +1182,7 @@ TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource,
* haven't received one yet already */ * haven't received one yet already */
for (i = 0; i < ti->num_listeners; i++) { for (i = 0; i < ti->num_listeners; i++) {
if (ti->listeners[i].listener == resource) { if (ti->listeners[i].listener == resource) {
if (ti->listeners[i].state != LISTENER_HAS_END) if (ti->listeners[i].state != TOUCH_LISTENER_HAS_END)
TouchEmitTouchEnd(sourcedev, ti, TOUCH_REJECT, resource); TouchEmitTouchEnd(sourcedev, ti, TOUCH_REJECT, resource);
break; break;
} }
@ -1228,12 +1228,12 @@ ProcessTouchOwnershipEvent(TouchOwnershipEvent *ev,
/* For pointer-emulated listeners that ungrabbed the active grab, /* For pointer-emulated listeners that ungrabbed the active grab,
* the state was forced to LISTENER_HAS_END. Still go * the state was forced to TOUCH_LISTENER_HAS_END. Still go
* through the motions of ending the touch if the listener has * through the motions of ending the touch if the listener has
* already seen the end. This ensures that the touch record is ended in * already seen the end. This ensures that the touch record is ended in
* the server. * the server.
*/ */
if (ti->listeners[0].state == LISTENER_HAS_END) if (ti->listeners[0].state == TOUCH_LISTENER_HAS_END)
TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener); TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener);
/* The touch owner has accepted the touch. Send TouchEnd events to /* The touch owner has accepted the touch. Send TouchEnd events to
@ -1244,10 +1244,10 @@ ProcessTouchOwnershipEvent(TouchOwnershipEvent *ev,
while (ti->num_listeners > 1) while (ti->num_listeners > 1)
TouchRemoveListener(ti, ti->listeners[1].listener); TouchRemoveListener(ti, ti->listeners[1].listener);
/* Owner accepted after receiving end */ /* Owner accepted after receiving end */
if (ti->listeners[0].state == LISTENER_HAS_END) if (ti->listeners[0].state == TOUCH_LISTENER_HAS_END)
TouchEndTouch(dev, ti); TouchEndTouch(dev, ti);
else else
ti->listeners[0].state = LISTENER_HAS_ACCEPTED; ti->listeners[0].state = TOUCH_LISTENER_HAS_ACCEPTED;
} }
else { /* this is the very first ownership event for a grab */ else { /* this is the very first ownership event for a grab */
DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource); DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource);
@ -1294,8 +1294,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
*mask = NULL; *mask = NULL;
*grab = NULL; *grab = NULL;
if (listener->type == LISTENER_GRAB || if (listener->type == TOUCH_LISTENER_GRAB ||
listener->type == LISTENER_POINTER_GRAB) { listener->type == TOUCH_LISTENER_POINTER_GRAB) {
*grab = listener->grab; *grab = listener->grab;
BUG_RETURN_VAL(!*grab, FALSE); BUG_RETURN_VAL(!*grab, FALSE);
@ -1322,7 +1322,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
int evtype; int evtype;
if (ti->emulate_pointer && if (ti->emulate_pointer &&
listener->type == LISTENER_POINTER_REGULAR) listener->type == TOUCH_LISTENER_POINTER_REGULAR)
evtype = GetXI2Type(TouchGetPointerEventType(ev)); evtype = GetXI2Type(TouchGetPointerEventType(ev));
else else
evtype = GetXI2Type(ev->any.type); evtype = GetXI2Type(ev->any.type);
@ -1463,16 +1463,16 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
//l->resource_type = RT_NONE; //l->resource_type = RT_NONE;
if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin) if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
l->type = LISTENER_POINTER_GRAB; l->type = TOUCH_LISTENER_POINTER_GRAB;
else else
l->type = LISTENER_GRAB; l->type = TOUCH_LISTENER_GRAB;
} }
} }
if (ev->any.type == ET_TouchBegin) if (ev->any.type == ET_TouchBegin)
listener->state = LISTENER_IS_OWNER; listener->state = TOUCH_LISTENER_IS_OWNER;
else if (ev->any.type == ET_TouchEnd) else if (ev->any.type == ET_TouchEnd)
listener->state = LISTENER_HAS_END; listener->state = TOUCH_LISTENER_HAS_END;
return Success; return Success;
} }
@ -1489,8 +1489,8 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
GrabPtr grab; GrabPtr grab;
XI2Mask *mask; XI2Mask *mask;
if (ti->listeners[0].type != LISTENER_POINTER_REGULAR && if (ti->listeners[0].type != TOUCH_LISTENER_POINTER_REGULAR &&
ti->listeners[0].type != LISTENER_POINTER_GRAB) ti->listeners[0].type != TOUCH_LISTENER_POINTER_GRAB)
return; return;
motion = ev->device_event; motion = ev->device_event;
@ -1879,14 +1879,14 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
int rc = Success; int rc = Success;
Bool has_ownershipmask; Bool has_ownershipmask;
if (listener->type == LISTENER_POINTER_REGULAR || if (listener->type == TOUCH_LISTENER_POINTER_REGULAR ||
listener->type == LISTENER_POINTER_GRAB) { listener->type == TOUCH_LISTENER_POINTER_GRAB) {
rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
grab, xi2mask); grab, xi2mask);
if (rc == Success) { if (rc == Success) {
listener->state = LISTENER_IS_OWNER; listener->state = TOUCH_LISTENER_IS_OWNER;
/* async grabs cannot replay, so automatically accept this touch */ /* async grabs cannot replay, so automatically accept this touch */
if (listener->type == LISTENER_POINTER_GRAB && if (listener->type == TOUCH_LISTENER_POINTER_GRAB &&
dev->deviceGrab.grab && dev->deviceGrab.grab &&
dev->deviceGrab.fromPassiveGrab && dev->deviceGrab.fromPassiveGrab &&
dev->deviceGrab.grab->pointerMode == GrabModeAsync) dev->deviceGrab.grab->pointerMode == GrabModeAsync)
@ -1901,18 +1901,18 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
if (!TouchResourceIsOwner(ti, listener->listener)) { if (!TouchResourceIsOwner(ti, listener->listener)) {
if (has_ownershipmask) if (has_ownershipmask)
state = LISTENER_AWAITING_OWNER; state = TOUCH_LISTENER_AWAITING_OWNER;
else else
state = LISTENER_AWAITING_BEGIN; state = TOUCH_LISTENER_AWAITING_BEGIN;
} }
else { else {
if (has_ownershipmask) if (has_ownershipmask)
TouchSendOwnershipEvent(dev, ti, 0, listener->listener); TouchSendOwnershipEvent(dev, ti, 0, listener->listener);
if (listener->type == LISTENER_REGULAR) if (listener->type == TOUCH_LISTENER_REGULAR)
state = LISTENER_HAS_ACCEPTED; state = TOUCH_LISTENER_HAS_ACCEPTED;
else else
state = LISTENER_IS_OWNER; state = TOUCH_LISTENER_IS_OWNER;
} }
listener->state = state; listener->state = state;
@ -1927,14 +1927,14 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
{ {
int rc = Success; int rc = Success;
if (listener->type == LISTENER_POINTER_REGULAR || if (listener->type == TOUCH_LISTENER_POINTER_REGULAR ||
listener->type == LISTENER_POINTER_GRAB) { listener->type == TOUCH_LISTENER_POINTER_GRAB) {
/* Note: If the active grab was ungrabbed, we already changed the /* Note: If the active grab was ungrabbed, we already changed the
* state to LISTENER_HAS_END but still get here. So we mustn't * state to TOUCH_LISTENER_HAS_END but still get here. So we mustn't
* actually send the event. * actually send the event.
* This is part two of the hack in DeactivatePointerGrab * This is part two of the hack in DeactivatePointerGrab
*/ */
if (listener->state != LISTENER_HAS_END) { if (listener->state != TOUCH_LISTENER_HAS_END) {
rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
grab, xi2mask); grab, xi2mask);
@ -1944,14 +1944,14 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
* and we can continue. * and we can continue.
*/ */
if (rc == Success) if (rc == Success)
listener->state = LISTENER_HAS_END; listener->state = TOUCH_LISTENER_HAS_END;
} }
goto out; goto out;
} }
/* A client is waiting for the begin, don't give it a TouchEnd */ /* A client is waiting for the begin, don't give it a TouchEnd */
if (listener->state == LISTENER_AWAITING_BEGIN) { if (listener->state == TOUCH_LISTENER_AWAITING_BEGIN) {
listener->state = LISTENER_HAS_END; listener->state = TOUCH_LISTENER_HAS_END;
goto out; goto out;
} }
@ -1959,19 +1959,19 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
if (ev->device_event.flags & TOUCH_REJECT || if (ev->device_event.flags & TOUCH_REJECT ||
(ev->device_event.flags & TOUCH_ACCEPT && !TouchResourceIsOwner(ti, listener->listener))) { (ev->device_event.flags & TOUCH_ACCEPT && !TouchResourceIsOwner(ti, listener->listener))) {
/* Touch has been rejected, or accepted by its owner which is not this listener */ /* Touch has been rejected, or accepted by its owner which is not this listener */
if (listener->state != LISTENER_HAS_END) if (listener->state != TOUCH_LISTENER_HAS_END)
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
listener->state = LISTENER_HAS_END; listener->state = TOUCH_LISTENER_HAS_END;
} }
else if (TouchResourceIsOwner(ti, listener->listener)) { else if (TouchResourceIsOwner(ti, listener->listener)) {
Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT); Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT);
/* FIXME: what about early acceptance */ /* FIXME: what about early acceptance */
if (normal_end && listener->state != LISTENER_HAS_END) if (normal_end && listener->state != TOUCH_LISTENER_HAS_END)
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
if ((ti->num_listeners > 1 || if ((ti->num_listeners > 1 ||
(ti->num_grabs > 0 && listener->state != LISTENER_HAS_ACCEPTED)) && (ti->num_grabs > 0 && listener->state != TOUCH_LISTENER_HAS_ACCEPTED)) &&
(ev->device_event.flags & (TOUCH_ACCEPT | TOUCH_REJECT)) == 0) { (ev->device_event.flags & (TOUCH_ACCEPT | TOUCH_REJECT)) == 0) {
ev->any.type = ET_TouchUpdate; ev->any.type = ET_TouchUpdate;
ev->device_event.flags |= TOUCH_PENDING_END; ev->device_event.flags |= TOUCH_PENDING_END;
@ -1979,7 +1979,7 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
} }
if (normal_end) if (normal_end)
listener->state = LISTENER_HAS_END; listener->state = TOUCH_LISTENER_HAS_END;
} }
out: out:
@ -2002,7 +2002,7 @@ DeliverTouchEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
if (!TouchResourceIsOwner(ti, listener->listener)) if (!TouchResourceIsOwner(ti, listener->listener))
goto out; goto out;
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
listener->state = LISTENER_IS_OWNER; listener->state = TOUCH_LISTENER_IS_OWNER;
} }
else else
ev->device_event.deviceid = dev->id; ev->device_event.deviceid = dev->id;
@ -2012,8 +2012,8 @@ DeliverTouchEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
xi2mask); xi2mask);
} }
else if (ev->any.type == ET_TouchUpdate) { else if (ev->any.type == ET_TouchUpdate) {
if (listener->type == LISTENER_POINTER_REGULAR || if (listener->type == TOUCH_LISTENER_POINTER_REGULAR ||
listener->type == LISTENER_POINTER_GRAB) listener->type == TOUCH_LISTENER_POINTER_GRAB)
DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab, DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win, grab,
xi2mask); xi2mask);
else if (TouchResourceIsOwner(ti, listener->listener) || else if (TouchResourceIsOwner(ti, listener->listener) ||

View File

@ -1480,14 +1480,14 @@ UpdateTouchesForGrab(DeviceIntPtr mouse)
CLIENT_BITS(listener->listener) == grab->resource) { CLIENT_BITS(listener->listener) == grab->resource) {
listener->listener = grab->resource; listener->listener = grab->resource;
listener->level = grab->grabtype; listener->level = grab->grabtype;
listener->state = LISTENER_IS_OWNER; listener->state = TOUCH_LISTENER_IS_OWNER;
listener->window = grab->window; listener->window = grab->window;
if (grab->grabtype == CORE || grab->grabtype == XI || if (grab->grabtype == CORE || grab->grabtype == XI ||
!xi2mask_isset(grab->xi2mask, mouse, XI_TouchBegin)) !xi2mask_isset(grab->xi2mask, mouse, XI_TouchBegin))
listener->type = LISTENER_POINTER_GRAB; listener->type = TOUCH_LISTENER_POINTER_GRAB;
else else
listener->type = LISTENER_GRAB; listener->type = TOUCH_LISTENER_GRAB;
if (listener->grab) if (listener->grab)
FreeGrab(listener->grab); FreeGrab(listener->grab);
listener->grab = AllocGrab(grab); listener->grab = AllocGrab(grab);
@ -1583,7 +1583,7 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
* ProcessTouchOwnershipEvent() will still call * ProcessTouchOwnershipEvent() will still call
* TouchEmitTouchEnd for this listener. The other half of * TouchEmitTouchEnd for this listener. The other half of
* this hack is in DeliverTouchEndEvent */ * this hack is in DeliverTouchEndEvent */
ti->listeners[0].state = LISTENER_HAS_END; ti->listeners[0].state = TOUCH_LISTENER_HAS_END;
} }
TouchListenerAcceptReject(mouse, ti, 0, mode); TouchListenerAcceptReject(mouse, ti, 0, mode);
} }

View File

@ -682,7 +682,7 @@ TouchRemoveListener(TouchPointInfoPtr ti, XID resource)
ti->listeners[j] = ti->listeners[j + 1]; ti->listeners[j] = ti->listeners[j + 1];
ti->num_listeners--; ti->num_listeners--;
ti->listeners[ti->num_listeners].listener = 0; ti->listeners[ti->num_listeners].listener = 0;
ti->listeners[ti->num_listeners].state = LISTENER_AWAITING_BEGIN; ti->listeners[ti->num_listeners].state = TOUCH_LISTENER_AWAITING_BEGIN;
return TRUE; return TRUE;
} }
@ -693,7 +693,7 @@ static void
TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti, TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
InternalEvent *ev, GrabPtr grab) InternalEvent *ev, GrabPtr grab)
{ {
enum TouchListenerType type = LISTENER_GRAB; enum TouchListenerType type = TOUCH_LISTENER_GRAB;
/* FIXME: owner_events */ /* FIXME: owner_events */
@ -701,16 +701,16 @@ TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (!xi2mask_isset(grab->xi2mask, dev, XI_TouchOwnership)) if (!xi2mask_isset(grab->xi2mask, dev, XI_TouchOwnership))
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
if (!xi2mask_isset(grab->xi2mask, dev, XI_TouchBegin)) if (!xi2mask_isset(grab->xi2mask, dev, XI_TouchBegin))
type = LISTENER_POINTER_GRAB; type = TOUCH_LISTENER_POINTER_GRAB;
} }
else if (grab->grabtype == XI || grab->grabtype == CORE) { else if (grab->grabtype == XI || grab->grabtype == CORE) {
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
type = LISTENER_POINTER_GRAB; type = TOUCH_LISTENER_POINTER_GRAB;
} }
/* grab listeners are always RT_NONE since we keep the grab pointer */ /* grab listeners are always RT_NONE since we keep the grab pointer */
TouchAddListener(ti, grab->resource, RT_NONE, grab->grabtype, TouchAddListener(ti, grab->resource, RT_NONE, grab->grabtype,
type, LISTENER_AWAITING_BEGIN, grab->window, grab); type, TOUCH_LISTENER_AWAITING_BEGIN, grab->window, grab);
} }
/** /**
@ -738,7 +738,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
InputClients *iclients = NULL; InputClients *iclients = NULL;
OtherInputMasks *inputMasks = NULL; OtherInputMasks *inputMasks = NULL;
uint16_t evtype = 0; /* may be event type or emulated event type */ uint16_t evtype = 0; /* may be event type or emulated event type */
enum TouchListenerType type = LISTENER_REGULAR; enum TouchListenerType type = TOUCH_LISTENER_REGULAR;
int mask; int mask;
evtype = GetXI2Type(ev->any.type); evtype = GetXI2Type(ev->any.type);
@ -749,7 +749,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
mask = EventIsDeliverable(dev, TouchGetPointerEventType(ev), win); mask = EventIsDeliverable(dev, TouchGetPointerEventType(ev), win);
if (mask) { if (mask) {
evtype = GetXI2Type(TouchGetPointerEventType(ev)); evtype = GetXI2Type(TouchGetPointerEventType(ev));
type = LISTENER_POINTER_REGULAR; type = TOUCH_LISTENER_POINTER_REGULAR;
} }
} }
if (!mask) if (!mask)
@ -766,7 +766,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI2, TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI2,
type, LISTENER_AWAITING_BEGIN, win, NULL); type, TOUCH_LISTENER_AWAITING_BEGIN, win, NULL);
return TRUE; return TRUE;
} }
} }
@ -781,7 +781,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI, TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI,
LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN, TOUCH_LISTENER_POINTER_REGULAR,
TOUCH_LISTENER_AWAITING_BEGIN,
win, NULL); win, NULL);
return TRUE; return TRUE;
} }
@ -796,7 +797,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (IsMaster(dev) && (win->eventMask & core_filter)) { if (IsMaster(dev) && (win->eventMask & core_filter)) {
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
TouchAddListener(ti, win->drawable.id, RT_WINDOW, CORE, TouchAddListener(ti, win->drawable.id, RT_WINDOW, CORE,
LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN, TOUCH_LISTENER_POINTER_REGULAR,
TOUCH_LISTENER_AWAITING_BEGIN,
win, NULL); win, NULL);
return TRUE; return TRUE;
} }
@ -808,7 +810,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
TouchEventHistoryAllocate(ti); TouchEventHistoryAllocate(ti);
TouchAddListener(ti, oclients->resource, RT_OTHERCLIENT, CORE, TouchAddListener(ti, oclients->resource, RT_OTHERCLIENT, CORE,
type, LISTENER_AWAITING_BEGIN, win, NULL); type, TOUCH_LISTENER_AWAITING_BEGIN, win, NULL);
return TRUE; return TRUE;
} }
} }
@ -950,7 +952,7 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
if (mode == XIRejectTouch) if (mode == XIRejectTouch)
TouchRejected(dev, ti, ti->listeners[listener].listener, NULL); TouchRejected(dev, ti, ti->listeners[listener].listener, NULL);
else else
ti->listeners[listener].state = LISTENER_EARLY_ACCEPT; ti->listeners[listener].state = TOUCH_LISTENER_EARLY_ACCEPT;
return Success; return Success;
} }

View File

@ -555,20 +555,21 @@ extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *
extern _X_EXPORT void FreeInputAttributes(InputAttributes * attrs); extern _X_EXPORT void FreeInputAttributes(InputAttributes * attrs);
enum TouchListenerState { enum TouchListenerState {
LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */ TOUCH_LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */
LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */ TOUCH_LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */
LISTENER_EARLY_ACCEPT, /**< Waiting for ownership, has already TOUCH_LISTENER_EARLY_ACCEPT, /**< Waiting for ownership, has already
accepted */ accepted */
LISTENER_IS_OWNER, /**< Is the current owner, hasn't accepted */ TOUCH_LISTENER_IS_OWNER, /**< Is the current owner, hasn't
LISTENER_HAS_ACCEPTED, /**< Is the current owner, has accepted */ accepted */
LISTENER_HAS_END, /**< Has already received the end event */ TOUCH_LISTENER_HAS_ACCEPTED, /**< Is the current owner, has accepted */
TOUCH_LISTENER_HAS_END, /**< Has already received the end event */
}; };
enum TouchListenerType { enum TouchListenerType {
LISTENER_GRAB, TOUCH_LISTENER_GRAB,
LISTENER_POINTER_GRAB, TOUCH_LISTENER_POINTER_GRAB,
LISTENER_REGULAR, TOUCH_LISTENER_REGULAR,
LISTENER_POINTER_REGULAR, TOUCH_LISTENER_POINTER_REGULAR,
}; };
extern void TouchInitDDXTouchPoint(DeviceIntPtr dev, extern void TouchInitDDXTouchPoint(DeviceIntPtr dev,