dix: add dixClientForInputClients()
Helper function for retrieving the owning client of an InputClients. It's an actual function, so callers don't need access to internal knowledge (definition of struct _InputClients, clients[] array, ...) Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
0ca0c334d8
commit
e1f8794b1d
|
@ -1047,7 +1047,7 @@ TouchClientWantsOwnershipEvents(ClientPtr client, DeviceIntPtr dev,
|
||||||
|
|
||||||
assert(wOtherInputMasks(win));
|
assert(wOtherInputMasks(win));
|
||||||
nt_list_for_each_entry(iclient, wOtherInputMasks(win)->inputClients, next) {
|
nt_list_for_each_entry(iclient, wOtherInputMasks(win)->inputClients, next) {
|
||||||
if (rClient(iclient) != client)
|
if (dixClientForInputClients(iclient) != client)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return xi2mask_isset(iclient->xi2mask, dev, XI_TouchOwnership);
|
return xi2mask_isset(iclient->xi2mask, dev, XI_TouchOwnership);
|
||||||
|
@ -1401,7 +1401,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
BUG_RETURN_VAL(!iclients, FALSE);
|
BUG_RETURN_VAL(!iclients, FALSE);
|
||||||
|
|
||||||
*mask = iclients->xi2mask;
|
*mask = iclients->xi2mask;
|
||||||
*client = rClient(iclients);
|
*client = dixClientForInputClients(iclients);
|
||||||
}
|
}
|
||||||
else if (listener->level == XI) {
|
else if (listener->level == XI) {
|
||||||
int xi_type = GetXIType(TouchGetPointerEventType(ev));
|
int xi_type = GetXIType(TouchGetPointerEventType(ev));
|
||||||
|
@ -1414,7 +1414,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
||||||
break;
|
break;
|
||||||
BUG_RETURN_VAL(!iclients, FALSE);
|
BUG_RETURN_VAL(!iclients, FALSE);
|
||||||
|
|
||||||
*client = rClient(iclients);
|
*client = dixClientForInputClients(iclients);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int coretype = GetCoreType(TouchGetPointerEventType(ev));
|
int coretype = GetCoreType(TouchGetPointerEventType(ev));
|
||||||
|
@ -2304,7 +2304,7 @@ RetrieveGestureDeliveryData(DeviceIntPtr dev, InternalEvent *ev, GestureListener
|
||||||
|
|
||||||
BUG_RETURN_VAL(!iclients, FALSE);
|
BUG_RETURN_VAL(!iclients, FALSE);
|
||||||
|
|
||||||
*client = rClient(iclients);
|
*client = dixClientForInputClients(iclients);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -2271,7 +2271,7 @@ DeliverEventToInputClients(DeviceIntPtr dev, InputClients * inputclients,
|
||||||
|
|
||||||
for (; inputclients; inputclients = inputclients->next) {
|
for (; inputclients; inputclients = inputclients->next) {
|
||||||
Mask mask;
|
Mask mask;
|
||||||
ClientPtr client = rClient(inputclients);
|
ClientPtr client = dixClientForInputClients(inputclients);
|
||||||
|
|
||||||
if (IsInterferingGrab(client, dev, events))
|
if (IsInterferingGrab(client, dev, events))
|
||||||
continue;
|
continue;
|
||||||
|
@ -2507,7 +2507,7 @@ DeliverRawEvent(RawDeviceEvent *ev, DeviceIntPtr device)
|
||||||
*/
|
*/
|
||||||
ic.next = NULL;
|
ic.next = NULL;
|
||||||
|
|
||||||
if (!FilterRawEvents(rClient(&ic), grab, root))
|
if (!FilterRawEvents(dixClientForInputClients(&ic), grab, root))
|
||||||
DeliverEventToInputClients(device, &ic, root, xi, 1,
|
DeliverEventToInputClients(device, &ic, root, xi, 1,
|
||||||
filter, NULL, &c, &m);
|
filter, NULL, &c, &m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,3 +25,10 @@ ClientPtr dixClientForGrab(GrabPtr pGrab) {
|
||||||
|
|
||||||
return clients[CLIENT_ID(pGrab->resource)];
|
return clients[CLIENT_ID(pGrab->resource)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClientPtr dixClientForInputClients(InputClientsPtr pInputClients) {
|
||||||
|
if (!pInputClients)
|
||||||
|
return NullClient;
|
||||||
|
|
||||||
|
return clients[CLIENT_ID(pInputClients->resource)];
|
||||||
|
}
|
||||||
|
|
|
@ -29,4 +29,15 @@ ClientPtr dixClientForWindow(WindowPtr pWin);
|
||||||
*/
|
*/
|
||||||
ClientPtr dixClientForGrab(GrabPtr pGrab);
|
ClientPtr dixClientForGrab(GrabPtr pGrab);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @brief retrieve client that owns InputClients
|
||||||
|
*
|
||||||
|
* XIDs carry the ID of the client who created/owns the resource in upper bits.
|
||||||
|
* (every client so is assigned a range of XIDs it may use for resource creation)
|
||||||
|
*
|
||||||
|
* @param GrabPtr to the InputClients whose owning client shall be retrieved
|
||||||
|
* @return pointer to ClientRec structure or NullClient (NULL)
|
||||||
|
*/
|
||||||
|
ClientPtr dixClientForInputClients(InputClientsPtr pInputClients);
|
||||||
|
|
||||||
#endif /* _XSERVER_DIX_RESOURCE_PRIV_H */
|
#endif /* _XSERVER_DIX_RESOURCE_PRIV_H */
|
||||||
|
|
Loading…
Reference in New Issue