diff options
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/ungrdevk.c')
-rw-r--r-- | nx-X11/programs/Xserver/Xi/ungrdevk.c | 98 |
1 files changed, 41 insertions, 57 deletions
diff --git a/nx-X11/programs/Xserver/Xi/ungrdevk.c b/nx-X11/programs/Xserver/Xi/ungrdevk.c index af3bb2348..42ebcd6ed 100644 --- a/nx-X11/programs/Xserver/Xi/ungrdevk.c +++ b/nx-X11/programs/Xserver/Xi/ungrdevk.c @@ -55,14 +55,14 @@ SOFTWARE. #include <dix-config.h> #endif -#include <nx-X11/X.h> /* for inputstr.h */ -#include <nx-X11/Xproto.h> /* Request macro */ -#include "inputstr.h" /* DeviceIntPtr */ -#include "windowstr.h" /* window structure */ +#include <nx-X11/X.h> /* for inputstr.h */ +#include <nx-X11/Xproto.h> /* Request macro */ +#include "inputstr.h" /* DeviceIntPtr */ +#include "windowstr.h" /* window structure */ #include <nx-X11/extensions/XI.h> #include <nx-X11/extensions/XIproto.h> #include "extnsionst.h" -#include "extinit.h" /* LookupDeviceIntRec */ +#include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" #include "dixgrabs.h" @@ -79,16 +79,15 @@ SOFTWARE. */ int -SProcXUngrabDeviceKey(client) - register ClientPtr client; - { +SProcXUngrabDeviceKey(register ClientPtr client) +{ REQUEST(xUngrabDeviceKeyReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); - return(ProcXUngrabDeviceKey(client)); - } + return (ProcXUngrabDeviceKey(client)); +} /*********************************************************************** * @@ -97,76 +96,61 @@ SProcXUngrabDeviceKey(client) */ int -ProcXUngrabDeviceKey(client) - ClientPtr client; - { - DeviceIntPtr dev; - DeviceIntPtr mdev; - WindowPtr pWin; - GrabRec temporaryGrab; +ProcXUngrabDeviceKey(ClientPtr client) +{ + DeviceIntPtr dev; + DeviceIntPtr mdev; + WindowPtr pWin; + GrabRec temporaryGrab; REQUEST(xUngrabDeviceKeyReq); REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); - dev = LookupDeviceIntRec (stuff->grabbed_device); - if (dev == NULL) - { - SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, - BadDevice); + dev = LookupDeviceIntRec(stuff->grabbed_device); + if (dev == NULL) { + SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadDevice); return Success; - } - if (dev->key == NULL) - { + } + if (dev->key == NULL) { SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadMatch); return Success; - } + } - if (stuff->modifier_device != UseXKeyboard) - { - mdev = LookupDeviceIntRec (stuff->modifier_device); - if (mdev == NULL) - { - SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, - BadDevice); + if (stuff->modifier_device != UseXKeyboard) { + mdev = LookupDeviceIntRec(stuff->modifier_device); + if (mdev == NULL) { + SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, + BadDevice); return Success; - } - if (mdev->key == NULL) - { - SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, - BadMatch); + } + if (mdev->key == NULL) { + SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadMatch); return Success; - } } - else + } else mdev = (DeviceIntPtr) LookupKeyboardDevice(); pWin = LookupWindow(stuff->grabWindow, client); - if (!pWin) - { - SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, - BadWindow); + if (!pWin) { + SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadWindow); return Success; - } + } if (((stuff->key > dev->key->curKeySyms.maxKeyCode) || (stuff->key < dev->key->curKeySyms.minKeyCode)) - && (stuff->key != AnyKey)) - { - SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, - BadValue); + && (stuff->key != AnyKey)) { + SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadValue); return Success; - } + } if ((stuff->modifiers != AnyModifier) && - (stuff->modifiers & ~AllModifiersMask)) - { - SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, - BadValue); + (stuff->modifiers & ~AllModifiersMask)) { + SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadValue); return Success; - } + } temporaryGrab.resource = client->clientAsMask; temporaryGrab.device = dev; temporaryGrab.window = pWin; - temporaryGrab.type = DeviceKeyPress; + temporaryGrab.type = DeviceKeyPress; temporaryGrab.modifierDevice = mdev; temporaryGrab.modifiersDetail.exact = stuff->modifiers; temporaryGrab.modifiersDetail.pMask = NULL; @@ -175,4 +159,4 @@ ProcXUngrabDeviceKey(client) DeletePassiveGrabFromList(&temporaryGrab); return Success; - } +} |