input: Add grabtype to GrabParameters.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-06-01 13:33:29 +10:00
parent bee02a1541
commit 080b0331b3
7 changed files with 15 additions and 0 deletions

View File

@ -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;

View File

@ -139,6 +139,7 @@ ProcXGrabDeviceButton(ClientPtr client)
return ret;
memset(&param, 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;

View File

@ -137,6 +137,7 @@ ProcXGrabDeviceKey(ClientPtr client)
memset(&param, 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;

View File

@ -130,6 +130,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
rep.num_modifiers = 0;
memset(&param, 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;

View File

@ -5172,6 +5172,7 @@ ProcGrabKey(ClientPtr client)
REQUEST_SIZE_MATCH(xGrabKeyReq);
memset(&param, 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(&param, 0, sizeof(param));
param.grabtype = GRABTYPE_CORE;
param.ownerEvents = stuff->ownerEvents;
param.this_device_mode = stuff->keyboardMode;
param.other_devices_mode = stuff->pointerMode;

View File

@ -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;

View File

@ -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;