diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index 25ecc035c..a5a957038 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -120,10 +120,10 @@ ProcXIPassiveGrabDevice(ClientPtr client) return BadValue; } - if ((stuff->mask_len * 4) > XI_LASTEVENT) + if ((stuff->mask_len * 4) > XI2LASTEVENT) { unsigned char *bits = (unsigned char*)&stuff[1]; - for (i = XI_LASTEVENT; i < stuff->mask_len * 4; i++) + for (i = XI2LASTEVENT; i < stuff->mask_len * 4; i++) { if (BitIsOn(bits, i)) return BadValue; diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index e6f36a762..6498d8677 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -108,10 +108,10 @@ ProcXISelectEvents(ClientPtr client) return BadValue; } - if ((evmask->mask_len * 4) >= (XI_LASTEVENT + 8)/8) + if ((evmask->mask_len * 4) >= (XI2LASTEVENT + 8)/8) { unsigned char *bits = (unsigned char*)&evmask[1]; - for (i = XI_LASTEVENT + 1; i < evmask->mask_len * 4; i++) + for (i = XI2LASTEVENT + 1; i < evmask->mask_len * 4; i++) { if (BitIsOn(bits, i)) return BadValue; diff --git a/dix/grabs.c b/dix/grabs.c index cc7747714..06d6d037c 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -53,6 +53,7 @@ SOFTWARE. #include #include "misc.h" #include +#include #include "windowstr.h" #include "inputstr.h" #include "cursorstr.h" diff --git a/include/inputstr.h b/include/inputstr.h index f233034b0..ffeedb1fa 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -55,7 +55,6 @@ SOFTWARE. #include "cursorstr.h" #include "geext.h" #include "privates.h" -#include #define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))) #define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) @@ -65,7 +64,13 @@ SOFTWARE. (CLIENT_BITS((obj)->resource) == (client)->clientAsMask) #define EMASKSIZE MAXDEVICES + 2 -#define XI2MASKSIZE ((XI_LASTEVENT + 7)/8) /* no of bits for masks */ + +/* This is the last XI2 event supported by the server. If you add + * events to the protocol, the server will not support these events until + * this number here is bumped. + */ +#define XI2LASTEVENT 13 /* XI_PropertyEvent */ +#define XI2MASKSIZE ((XI2LASTEVENT + 7)/8) /* no of bits for masks */ /** * This struct stores the core event mask for each client except the client