diff options
Diffstat (limited to 'Xi/ungrdevb.c')
-rw-r--r-- | Xi/ungrdevb.c | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c index b9f236b76..0dfe805b7 100644 --- a/Xi/ungrdevb.c +++ b/Xi/ungrdevb.c @@ -56,13 +56,10 @@ 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 "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" #include "dixgrabs.h" @@ -111,41 +108,27 @@ ProcXUngrabDeviceButton(ClientPtr client) REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); dev = LookupDeviceIntRec(stuff->grabbed_device); - if (dev == NULL) { - SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadDevice); - return Success; - } - if (dev->button == NULL) { - SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadMatch); - return Success; - } + if (dev == NULL) + return BadDevice; + if (dev->button == NULL) + return BadMatch; if (stuff->modifier_device != UseXKeyboard) { mdev = LookupDeviceIntRec(stuff->modifier_device); - if (mdev == NULL) { - SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, - BadDevice); - return Success; - } - if (mdev->key == NULL) { - SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, - BadMatch); - return Success; - } + if (mdev == NULL) + return BadDevice; + if (mdev->key == NULL) + return BadMatch; } else mdev = (DeviceIntPtr) LookupKeyboardDevice(); rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess); - if (rc != Success) { - SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, rc); - return Success; - } + if (rc != Success) + return rc; if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) { - SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadValue); - return Success; - } + (stuff->modifiers & ~AllModifiersMask)) + return BadValue; temporaryGrab.resource = client->clientAsMask; temporaryGrab.device = dev; |