aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/opendev.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xi/opendev.c')
-rw-r--r--xorg-server/Xi/opendev.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xorg-server/Xi/opendev.c b/xorg-server/Xi/opendev.c
index acda38530..8d249278d 100644
--- a/xorg-server/Xi/opendev.c
+++ b/xorg-server/Xi/opendev.c
@@ -62,6 +62,7 @@ SOFTWARE.
#include "XIstubs.h"
#include "windowstr.h" /* window structure */
#include "exglobals.h"
+#include "exevents.h"
#include "opendev.h"
@@ -102,11 +103,8 @@ ProcXOpenDevice(ClientPtr client)
REQUEST(xOpenDeviceReq);
REQUEST_SIZE_MATCH(xOpenDeviceReq);
- if (stuff->deviceid == inputInfo.pointer->id ||
- stuff->deviceid == inputInfo.keyboard->id)
- return BadDevice;
-
status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
+
if (status == BadDevice) { /* not open */
for (dev = inputInfo.off_devices; dev; dev = dev->next)
if (dev->id == stuff->deviceid)
@@ -116,6 +114,9 @@ ProcXOpenDevice(ClientPtr client)
} else if (status != Success)
return status;
+ if (dev->isMaster)
+ return BadDevice;
+
OpenInputDevice(dev, client, &status);
if (status != Success)
return status;