aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/Xi/ungrdevk.c
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2018-02-26 01:00:54 +0100
committerMihai Moldovan <ionic@ionic.de>2018-02-26 01:00:54 +0100
commit05152b788ab184f45df1f64182791c88a09dc6f9 (patch)
tree4232012c65ee251fef529950a420689154778847 /nx-X11/programs/Xserver/Xi/ungrdevk.c
parente247900edd20c140faf42ba0759bf59cbd2f75ae (diff)
parent4598c0c3d215f7f2237a9ccee3a143025f2af005 (diff)
downloadnx-libs-05152b788ab184f45df1f64182791c88a09dc6f9.tar.gz
nx-libs-05152b788ab184f45df1f64182791c88a09dc6f9.tar.bz2
nx-libs-05152b788ab184f45df1f64182791c88a09dc6f9.zip
Merge branch 'uli42-pr/update_xi' into arctica-3.6.x
Attributes GH PR #644: https://github.com/ArcticaProject/nx-libs/pull/644
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/ungrdevk.c')
-rw-r--r--nx-X11/programs/Xserver/Xi/ungrdevk.c98
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;
- }
+}