dix: helper for retrieving client owning a XID
Add a little helper that's looking up the ClientPtr to the client of the owner of given XID. The lookup is solely done on the ID space, the actual resource doesn't even need to exist. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
8a3401c94c
commit
be465abc36
|
|
@ -278,4 +278,17 @@ void dixFreeScreen(ScreenPtr pScreen);
|
||||||
|
|
||||||
void dixFreeAllScreens(void);
|
void dixFreeAllScreens(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @brief retrieve owning client for given XID
|
||||||
|
*
|
||||||
|
* just lookup by ID space, the resource doens't need to actually exist
|
||||||
|
*/
|
||||||
|
static inline ClientPtr dixLookupXIDOwner(XID xid)
|
||||||
|
{
|
||||||
|
int clientId = CLIENT_ID(xid);
|
||||||
|
if (clientId < currentMaxClients)
|
||||||
|
return clients[clientId];
|
||||||
|
return NullClient;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* _XSERVER_DIX_PRIV_H */
|
#endif /* _XSERVER_DIX_PRIV_H */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue