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
16215b98d2
commit
950cfb2bdc
|
@ -18,6 +18,7 @@
|
|||
#include <X11/extensions/XI.h>
|
||||
|
||||
#include "dix/input_priv.h"
|
||||
#include "dix/resource_priv.h"
|
||||
|
||||
#include "include/callback.h"
|
||||
#include "include/cursor.h"
|
||||
|
@ -672,4 +673,17 @@ void WakeupHandler(int result);
|
|||
*/
|
||||
void InitBlockAndWakeupHandlers(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 = dixClientIdForXID(xid);
|
||||
if (clientId < currentMaxClients)
|
||||
return clients[clientId];
|
||||
return NullClient;
|
||||
}
|
||||
|
||||
#endif /* _XSERVER_DIX_PRIV_H */
|
||||
|
|
Loading…
Reference in New Issue