diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-10 14:41:11 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-11 13:42:49 +1000 |
commit | aa2babf11c30be4d289b58212dc330b84efb4053 (patch) | |
tree | 1a885aac1bee2b9b9dac5e6a717c6f2e01df60e6 | |
parent | 77cc816da4a2777110182ed01c22c0f5e6ac3b65 (diff) |
input: remove dependency on XI2 protocol for XI_LASTEVENT.
inputstr includes XI2proto.h for the sole purpose of XI_LASTEVENT.
However, using XI_LASTEVENT in the server is prone to errors, if the server
is recompiled against a newer version of the protocol it would bump this
variable and associates bits, including potential ABI.
This patch defines an XI2LASTEVENT for use in the server and removes the
XI2proto.h require. XI2LASTEVENT is the current value of XI_LASTEVENT.
This patch is required by components that require access to inputInfo
(currently xf86-video-geode and xf86-video-cirrus) but should not have a
require for the XI2 protocol.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | Xi/xipassivegrab.c | 4 | ||||
-rw-r--r-- | Xi/xiselectev.c | 4 | ||||
-rw-r--r-- | dix/grabs.c | 1 | ||||
-rw-r--r-- | include/inputstr.h | 9 |
4 files changed, 12 insertions, 6 deletions
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 <X11/X.h> #include "misc.h" #include <X11/Xproto.h> +#include <X11/extensions/XI2.h> #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 <X11/extensions/XI2proto.h> #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 |