diff options
-rw-r--r-- | Xi/exevents.c | 8 | ||||
-rw-r--r-- | Xi/grabdevb.c | 1 | ||||
-rw-r--r-- | Xi/grabdevk.c | 1 | ||||
-rw-r--r-- | Xi/xipassivegrab.c | 1 | ||||
-rw-r--r-- | dix/events.c | 2 | ||||
-rw-r--r-- | include/exevents.h | 1 | ||||
-rw-r--r-- | test/input.c | 1 |
7 files changed, 15 insertions, 0 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 781f4b858..5aca521c6 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1388,6 +1388,14 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, int CheckGrabValues(ClientPtr client, GrabParameters* param) { + if (param->grabtype != GRABTYPE_CORE && + param->grabtype != GRABTYPE_XI && + param->grabtype != GRABTYPE_XI2) + { + ErrorF("[Xi] grabtype is invalid. This is a bug.\n"); + return BadImplementation; + } + if ((param->this_device_mode != GrabModeSync) && (param->this_device_mode != GrabModeAsync)) { client->errorValue = param->this_device_mode; diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c index 0d1eb636b..7cd5cc474 100644 --- a/Xi/grabdevb.c +++ b/Xi/grabdevb.c @@ -139,6 +139,7 @@ ProcXGrabDeviceButton(ClientPtr client) return ret; memset(¶m, 0, sizeof(param)); + param.grabtype = GRABTYPE_XI; param.ownerEvents = stuff->ownerEvents; param.this_device_mode = stuff->this_device_mode; param.other_devices_mode = stuff->other_devices_mode; diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c index 96e2e62ac..5ffecd25d 100644 --- a/Xi/grabdevk.c +++ b/Xi/grabdevk.c @@ -137,6 +137,7 @@ ProcXGrabDeviceKey(ClientPtr client) memset(¶m, 0, sizeof(param)); + param.grabtype = GRABTYPE_XI; param.ownerEvents = stuff->ownerEvents; param.this_device_mode = stuff->this_device_mode; param.other_devices_mode = stuff->other_devices_mode; diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index fa76a770c..fab333592 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -130,6 +130,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) rep.num_modifiers = 0; memset(¶m, 0, sizeof(param)); + param.grabtype = GRABTYPE_XI2; param.ownerEvents = stuff->owner_events; param.this_device_mode = stuff->grab_mode; param.other_devices_mode = stuff->paired_device_mode; diff --git a/dix/events.c b/dix/events.c index b5b052181..229e67d36 100644 --- a/dix/events.c +++ b/dix/events.c @@ -5172,6 +5172,7 @@ ProcGrabKey(ClientPtr client) REQUEST_SIZE_MATCH(xGrabKeyReq); memset(¶m, 0, sizeof(param)); + param.grabtype = GRABTYPE_CORE; param.ownerEvents = stuff->ownerEvents; param.this_device_mode = stuff->keyboardMode; param.other_devices_mode = stuff->pointerMode; @@ -5287,6 +5288,7 @@ ProcGrabButton(ClientPtr client) return rc; memset(¶m, 0, sizeof(param)); + param.grabtype = GRABTYPE_CORE; param.ownerEvents = stuff->ownerEvents; param.this_device_mode = stuff->keyboardMode; param.other_devices_mode = stuff->pointerMode; diff --git a/include/exevents.h b/include/exevents.h index 5878413c2..80eaa768d 100644 --- a/include/exevents.h +++ b/include/exevents.h @@ -44,6 +44,7 @@ typedef struct _XIClientRec { typedef struct _GrabParameters { + int grabtype; /* GRABTYPE_CORE, etc. */ unsigned int ownerEvents; unsigned int this_device_mode; unsigned int other_devices_mode; diff --git a/test/input.c b/test/input.c index 466d18776..2f7bc7102 100644 --- a/test/input.c +++ b/test/input.c @@ -86,6 +86,7 @@ static void dix_check_grab_values(void) memset(&client, 0, sizeof(client)); + param.grabtype = GRABTYPE_CORE; param.this_device_mode = GrabModeSync; param.other_devices_mode = GrabModeSync; param.modifiers = AnyModifier; |