mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
Xi: inline SProcXIGrabDevice() and SProcXIUngrabDevice()
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
24f8535f28
commit
3b4ba245b7
@@ -454,9 +454,9 @@ SProcIDispatch(ClientPtr client)
|
||||
case X_XIGetFocus:
|
||||
return SProcXIGetFocus(client);
|
||||
case X_XIGrabDevice:
|
||||
return SProcXIGrabDevice(client);
|
||||
return ProcXIGrabDevice(client);
|
||||
case X_XIUngrabDevice:
|
||||
return SProcXIUngrabDevice(client);
|
||||
return ProcXIUngrabDevice(client);
|
||||
case X_XIAllowEvents:
|
||||
return SProcXIAllowEvents(client);
|
||||
case X_XIPassiveGrabDevice:
|
||||
|
||||
@@ -84,7 +84,6 @@ int SProcXIBarrierReleasePointer(ClientPtr client);
|
||||
int SProcXIGetClientPointer(ClientPtr client);
|
||||
int SProcXIGetFocus(ClientPtr client);
|
||||
int SProcXIGetSelectedEvents(ClientPtr client);
|
||||
int SProcXIGrabDevice(ClientPtr client);
|
||||
int SProcXIPassiveGrabDevice(ClientPtr client);
|
||||
int SProcXIPassiveUngrabDevice(ClientPtr client);
|
||||
int SProcXIQueryDevice(ClientPtr client);
|
||||
@@ -93,7 +92,6 @@ int SProcXIQueryVersion(ClientPtr client);
|
||||
int SProcXISelectEvents(ClientPtr client);
|
||||
int SProcXISetClientPointer(ClientPtr client);
|
||||
int SProcXISetFocus(ClientPtr client);
|
||||
int SProcXIUngrabDevice(ClientPtr client);
|
||||
int SProcXIWarpPointer(ClientPtr client);
|
||||
int SProcXSelectExtensionEvent(ClientPtr client);
|
||||
int SProcXSendExtensionEvent(ClientPtr client);
|
||||
|
||||
@@ -45,28 +45,20 @@
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "exglobals.h" /* BadDevice */
|
||||
|
||||
int _X_COLD
|
||||
SProcXIGrabDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXIGrabDeviceReq);
|
||||
/*
|
||||
* Check here for at least the length of the struct we swap, then
|
||||
* let ProcXIGrabDevice check the full size after we swap mask_len.
|
||||
*/
|
||||
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
|
||||
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->grab_window);
|
||||
swapl(&stuff->cursor);
|
||||
swapl(&stuff->time);
|
||||
swaps(&stuff->mask_len);
|
||||
|
||||
return ProcXIGrabDevice(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXIGrabDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXIGrabDeviceReq);
|
||||
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->grab_window);
|
||||
swapl(&stuff->cursor);
|
||||
swapl(&stuff->time);
|
||||
swaps(&stuff->mask_len);
|
||||
}
|
||||
|
||||
DeviceIntPtr dev;
|
||||
int ret = Success;
|
||||
uint8_t status;
|
||||
@@ -75,7 +67,6 @@ ProcXIGrabDevice(ClientPtr client)
|
||||
unsigned int keyboard_mode;
|
||||
unsigned int pointer_mode;
|
||||
|
||||
REQUEST(xXIGrabDeviceReq);
|
||||
REQUEST_FIXED_SIZE(xXIGrabDeviceReq, ((size_t) stuff->mask_len) * 4);
|
||||
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||
@@ -131,29 +122,22 @@ ProcXIGrabDevice(ClientPtr client)
|
||||
return X_SEND_REPLY_SIMPLE(client, rep);
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXIUngrabDevice(ClientPtr client)
|
||||
int
|
||||
ProcXIUngrabDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXIUngrabDeviceReq);
|
||||
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
|
||||
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->time);
|
||||
if (client->swapped) {
|
||||
swaps(&stuff->deviceid);
|
||||
swapl(&stuff->time);
|
||||
}
|
||||
|
||||
return ProcXIUngrabDevice(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXIUngrabDevice(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
GrabPtr grab;
|
||||
int ret = Success;
|
||||
TimeStamp time;
|
||||
|
||||
REQUEST(xXIUngrabDeviceReq);
|
||||
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
|
||||
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user