aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/selectev.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
committermarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
commit81f91c615982e50bb62708201569c33a3cd3d973 (patch)
tree4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/Xi/selectev.c
parentb571a562410f565af2bdde52d9f7f9a23ffae04f (diff)
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
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;
}