summaryrefslogtreecommitdiff
path: root/Xi/grabdevk.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-09-24 13:33:01 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-09-26 07:26:59 -0400
commit31a7994ac7365562ef1d00e0a7b25f967a961a4e (patch)
treea2054c0e371e9c62396f2e09df469142dca0a633 /Xi/grabdevk.c
parent56ffc381d32687242dd094395fcf2216339bab2a (diff)
Input: Return errors to the dispatcher instead of sending them ourself.
Also fixed two "unused variable: stuff" warnings.
Diffstat (limited to 'Xi/grabdevk.c')
-rw-r--r--Xi/grabdevk.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c
index b74592f19..8da36ba8f 100644
--- a/Xi/grabdevk.c
+++ b/Xi/grabdevk.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"
@@ -115,27 +112,19 @@ ProcXGrabDeviceKey(ClientPtr client)
REQUEST(xGrabDeviceKeyReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
- if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count) {
- SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadLength);
- return Success;
- }
+ if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count)
+ return BadLength;
dev = LookupDeviceIntRec(stuff->grabbed_device);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 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_GrabDeviceKey, 0, BadDevice);
- return Success;
- }
- if (mdev->key == NULL) {
- SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadMatch);
- return Success;
- }
+ if (mdev == NULL)
+ return BadDevice;
+ if (mdev->key == NULL)
+ return BadMatch;
} else
mdev = (DeviceIntPtr) LookupKeyboardDevice();
@@ -144,17 +133,12 @@ ProcXGrabDeviceKey(ClientPtr client)
if ((ret = CreateMaskFromList(client, class,
stuff->event_count, tmp, dev,
X_GrabDeviceKey)) != Success)
- return Success;
+ return ret;
ret = GrabKey(client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->modifiers, mdev,
stuff->key, stuff->grabWindow, stuff->ownerEvents,
tmp[stuff->grabbed_device].mask);
- if (ret != Success) {
- SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, ret);
- return Success;
- }
-
- return Success;
+ return ret;
}