aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/grabdevk.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/grabdevk.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/grabdevk.c')
-rw-r--r--xorg-server/Xi/grabdevk.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/xorg-server/Xi/grabdevk.c b/xorg-server/Xi/grabdevk.c
index 6a245f25a..b34867b5f 100644
--- a/xorg-server/Xi/grabdevk.c
+++ b/xorg-server/Xi/grabdevk.c
@@ -50,8 +50,6 @@ SOFTWARE.
*
*/
-#define NEED_EVENTS
-#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
@@ -103,11 +101,13 @@ ProcXGrabDeviceKey(ClientPtr client)
DeviceIntPtr mdev;
XEventClass *class;
struct tmask tmp[EMASKSIZE];
+ GrabParameters param;
+ GrabMask mask;
REQUEST(xGrabDeviceKeyReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
- if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count)
+ if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count)
return BadLength;
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
@@ -116,14 +116,14 @@ ProcXGrabDeviceKey(ClientPtr client)
if (stuff->modifier_device != UseXKeyboard) {
ret = dixLookupDevice(&mdev, stuff->modifier_device, client,
- DixReadAccess);
+ DixUseAccess);
if (ret != Success)
return ret;
if (mdev->key == NULL)
return BadMatch;
} else {
mdev = PickKeyboard(client);
- ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixReadAccess);
+ ret = XaceHook(XACE_DEVICE_ACCESS, client, mdev, DixUseAccess);
if (ret != Success)
return ret;
}
@@ -135,10 +135,17 @@ ProcXGrabDeviceKey(ClientPtr client)
X_GrabDeviceKey)) != Success)
return ret;
- ret = GrabKey(client, dev, stuff->this_device_mode,
- stuff->other_devices_mode, stuff->modifiers, mdev,
- stuff->key, stuff->grabWindow, stuff->ownerEvents,
- tmp[stuff->grabbed_device].mask);
+
+ 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;
+ param.grabWindow = stuff->grabWindow;
+ param.modifiers = stuff->modifiers;
+ mask.xi = tmp[stuff->grabbed_device].mask;
+
+ ret = GrabKey(client, dev, mdev, stuff->key, &param, GRABTYPE_XI, &mask);
return ret;
}