59
56
#include <dix-config.h>
62
#include <X11/X.h> /* for inputstr.h */
63
#include <X11/Xproto.h> /* Request macro */
64
#include "inputstr.h" /* DeviceIntPtr */
65
#include "windowstr.h" /* window structure */
59
#include <X11/X.h> /* for inputstr.h */
60
#include <X11/Xproto.h> /* Request macro */
61
#include "inputstr.h" /* DeviceIntPtr */
62
#include "windowstr.h" /* window structure */
66
63
#include <X11/extensions/XI.h>
67
64
#include <X11/extensions/XIproto.h>
68
65
#include "exevents.h"
69
66
#include "extnsionst.h"
70
#include "extinit.h" /* LookupDeviceIntRec */
67
#include "extinit.h" /* LookupDeviceIntRec */
71
68
#include "exglobals.h"
73
70
#include "grabdev.h"
113
ProcXGrabDeviceButton(client)
120
struct tmask tmp[EMASKSIZE];
108
ProcXGrabDeviceButton(ClientPtr client)
114
struct tmask tmp[EMASKSIZE];
122
116
REQUEST(xGrabDeviceButtonReq);
123
117
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
125
if (stuff->length !=(sizeof(xGrabDeviceButtonReq)>>2) + stuff->event_count)
127
SendErrorToClient (client, IReqCode, X_GrabDeviceButton, 0, BadLength);
120
(sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count) {
121
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, BadLength);
131
dev = LookupDeviceIntRec (stuff->grabbed_device);
134
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
125
dev = LookupDeviceIntRec(stuff->grabbed_device);
127
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, BadDevice);
138
if (stuff->modifier_device != UseXKeyboard)
140
mdev = LookupDeviceIntRec (stuff->modifier_device);
143
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
147
if (mdev->key == NULL)
149
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
130
if (stuff->modifier_device != UseXKeyboard) {
131
mdev = LookupDeviceIntRec(stuff->modifier_device);
133
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
137
if (mdev->key == NULL) {
138
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
155
143
mdev = (DeviceIntPtr) LookupKeyboardDevice();
157
145
class = (XEventClass *) (&stuff[1]); /* first word of values */
159
if ((ret = CreateMaskFromList (client, class,
160
stuff->event_count, tmp, dev, X_GrabDeviceButton)) != Success)
162
ret = GrabButton(client, dev, stuff->this_device_mode,
163
stuff->other_devices_mode, stuff->modifiers, mdev, stuff->button,
164
stuff->grabWindow, stuff->ownerEvents, (Cursor)0, (Window)0,
165
tmp[stuff->grabbed_device].mask);
147
if ((ret = CreateMaskFromList(client, class,
148
stuff->event_count, tmp, dev,
149
X_GrabDeviceButton)) != Success)
151
ret = GrabButton(client, dev, stuff->this_device_mode,
152
stuff->other_devices_mode, stuff->modifiers, mdev,
153
stuff->button, stuff->grabWindow, stuff->ownerEvents,
154
(Cursor) 0, (Window) 0, tmp[stuff->grabbed_device].mask);
167
156
if (ret != Success)
168
157
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, ret);