diff options
-rw-r--r-- | Xi/xisetclientpointer.c | 5 | ||||
-rw-r--r-- | dix/events.c | 12 | ||||
-rw-r--r-- | include/dix.h | 2 |
3 files changed, 12 insertions, 7 deletions
diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c index 273618503..09db8ff75 100644 --- a/Xi/xisetclientpointer.c +++ b/Xi/xisetclientpointer.c @@ -98,10 +98,11 @@ ProcXISetClientPointer(ClientPtr client) } else targetClient = client; - if (!SetClientPointer(targetClient, pDev)) + rc = SetClientPointer(targetClient, pDev); + if (rc != Success) { client->errorValue = stuff->deviceid; - return BadDevice; + return rc; } return Success; diff --git a/dix/events.c b/dix/events.c index 43e1bd27c..81e5b6d66 100644 --- a/dix/events.c +++ b/dix/events.c @@ -5699,21 +5699,25 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) * PickPointer()). * If a keyboard is needed, the first keyboard paired with the CP is used. */ -Bool +int SetClientPointer(ClientPtr client, DeviceIntPtr device) { + int rc = XaceHook(XACE_DEVICE_ACCESS, client, device, DixUseAccess); + if (rc != Success) + return rc; + if (!IsMaster(device)) { ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n"); - return FALSE; + return BadDevice; } else if (!device->spriteInfo->spriteOwner) { ErrorF("[dix] Device %d does not have a sprite. " "Cannot be ClientPointer\n", device->id); - return FALSE; + return BadDevice; } client->clientPtr = device; - return TRUE; + return Success; } /* PickPointer will pick an appropriate pointer for the given client. diff --git a/include/dix.h b/include/dix.h index c4a639467..c6e52e71d 100644 --- a/include/dix.h +++ b/include/dix.h @@ -485,7 +485,7 @@ extern _X_EXPORT int TryClientEvents( extern _X_EXPORT void WindowsRestructured(void); -extern Bool SetClientPointer( +extern int SetClientPointer( ClientPtr /* client */, DeviceIntPtr /* device */); |