summaryrefslogtreecommitdiff
path: root/Xi/grabdevb.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xi/grabdevb.c')
-rw-r--r--Xi/grabdevb.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c
index df62d0c69..21e46fceb 100644
--- a/Xi/grabdevb.c
+++ b/Xi/grabdevb.c
@@ -56,14 +56,11 @@ SOFTWARE.
#include <dix-config.h>
#endif
-#include <X11/X.h> /* for inputstr.h */
-#include <X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "exevents.h"
-#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
@@ -117,28 +114,19 @@ ProcXGrabDeviceButton(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
if (stuff->length !=
- (sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count) {
- SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, BadLength);
- return Success;
- }
+ (sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count)
+ return BadLength;
dev = LookupDeviceIntRec(stuff->grabbed_device);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, BadDevice);
- return Success;
- }
+ if (dev == NULL)
+ return BadDevice;
+
if (stuff->modifier_device != UseXKeyboard) {
mdev = LookupDeviceIntRec(stuff->modifier_device);
- if (mdev == NULL) {
- SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
- BadDevice);
- return Success;
- }
- if (mdev->key == NULL) {
- SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
- BadMatch);
- return Success;
- }
+ if (mdev == NULL)
+ return BadDevice;
+ if (mdev->key == NULL)
+ return BadMatch;
} else
mdev = (DeviceIntPtr) LookupKeyboardDevice();
@@ -147,13 +135,11 @@ ProcXGrabDeviceButton(ClientPtr client)
if ((ret = CreateMaskFromList(client, class,
stuff->event_count, tmp, dev,
X_GrabDeviceButton)) != Success)
- return Success;
+ return ret;
ret = GrabButton(client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->modifiers, mdev,
stuff->button, stuff->grabWindow, stuff->ownerEvents,
(Cursor) 0, (Window) 0, tmp[stuff->grabbed_device].mask);
- if (ret != Success)
- SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, ret);
- return (Success);
+ return ret;
}