mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
Xi: inline SProcXGrabDeviceKey()
No need to have a hole bunch of extra functions, if we can just easily inline the few relevant lines. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
0c40403eb7
commit
3f5fdfc615
@@ -380,7 +380,7 @@ SProcIDispatch(ClientPtr client)
|
||||
case X_UngrabDevice:
|
||||
return ProcXUngrabDevice(client);
|
||||
case X_GrabDeviceKey:
|
||||
return SProcXGrabDeviceKey(client);
|
||||
return ProcXGrabDeviceKey(client);
|
||||
case X_UngrabDeviceKey:
|
||||
return SProcXUngrabDeviceKey(client);
|
||||
case X_GrabDeviceButton:
|
||||
|
||||
@@ -64,25 +64,6 @@ SOFTWARE.
|
||||
#include "xace.h"
|
||||
#include "grabdev.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Handle requests from clients with a different byte order.
|
||||
*
|
||||
*/
|
||||
|
||||
int _X_COLD
|
||||
SProcXGrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGrabDeviceKeyReq);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
swaps(&stuff->event_count);
|
||||
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
||||
return (ProcXGrabDeviceKey(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Grab a key on an extension device.
|
||||
@@ -92,6 +73,20 @@ SProcXGrabDeviceKey(ClientPtr client)
|
||||
int
|
||||
ProcXGrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
REQUEST(xGrabDeviceKeyReq);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&stuff->grabWindow);
|
||||
swaps(&stuff->modifiers);
|
||||
swaps(&stuff->event_count);
|
||||
}
|
||||
|
||||
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
|
||||
|
||||
if (client->swapped)
|
||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
||||
|
||||
int ret;
|
||||
DeviceIntPtr dev;
|
||||
DeviceIntPtr mdev;
|
||||
@@ -99,13 +94,6 @@ ProcXGrabDeviceKey(ClientPtr client)
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
GrabMask mask;
|
||||
|
||||
REQUEST(xGrabDeviceKeyReq);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
||||
|
||||
if (client->req_len !=
|
||||
bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
@@ -74,7 +74,6 @@ int SProcXGetDeviceMotionEvents(ClientPtr client);
|
||||
int SProcXGetExtensionVersion(ClientPtr client);
|
||||
int SProcXGetSelectedExtensionEvents(ClientPtr client);
|
||||
int SProcXGrabDeviceButton(ClientPtr client);
|
||||
int SProcXGrabDeviceKey(ClientPtr client);
|
||||
int SProcXIAllowEvents(ClientPtr client);
|
||||
int SProcXIBarrierReleasePointer(ClientPtr client);
|
||||
int SProcXIGetClientPointer(ClientPtr client);
|
||||
|
||||
Reference in New Issue
Block a user