aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/selectev.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xi/selectev.c')
-rw-r--r--xorg-server/Xi/selectev.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/xorg-server/Xi/selectev.c b/xorg-server/Xi/selectev.c
index 9c336fce5..031e602ad 100644
--- a/xorg-server/Xi/selectev.c
+++ b/xorg-server/Xi/selectev.c
@@ -50,8 +50,6 @@ SOFTWARE.
*
*/
-#define NEED_EVENTS
-#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
@@ -60,6 +58,7 @@ SOFTWARE.
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <X11/extensions/XI.h>
+#include <X11/extensions/XI2.h>
#include <X11/extensions/XIproto.h>
#include "exevents.h"
#include "exglobals.h"
@@ -68,7 +67,6 @@ SOFTWARE.
#include "selectev.h"
extern Mask ExtExclusiveMasks[];
-extern Mask ExtValidMasks[];
static int
HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
@@ -106,10 +104,9 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
if (mask == 0)
return Success;
- /* We always only use mksidx = MAXDEVICES for events not bound to
+ /* We always only use mksidx = AllDevices for events not bound to
* devices */
-
- if (AddExtensionClient (win, client, mask, MAXDEVICES) != Success)
+ if (AddExtensionClient (win, client, mask, XIAllDevices) != Success)
return BadAlloc;
RecalculateDeviceDeliverableEvents(win);
@@ -157,7 +154,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
REQUEST(xSelectExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
- if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count)
+ if (stuff->length != bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count)
return BadLength;
ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
@@ -175,10 +172,13 @@ ProcXSelectExtensionEvent(ClientPtr client)
for (i = 0; i < EMASKSIZE; i++)
if (tmp[i].dev != NULL) {
+ if (tmp[i].mask & ~XIAllMasks) {
+ client->errorValue = tmp[i].mask;
+ return BadValue;
+ }
if ((ret =
SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client,
- tmp[i].mask, ExtExclusiveMasks[i],
- ExtValidMasks[i])) != Success)
+ tmp[i].mask, ExtExclusiveMasks[i]))!= Success)
return ret;
}