From a28cacbef2776c7f3c84895d5d33f7919ef23d93 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 17 Sep 2025 13:49:21 +0200 Subject: [PATCH] Xi: inline SProcXIAllowEvents() 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 --- Xi/extinit.c | 2 +- Xi/handlers.h | 1 - Xi/xiallowev.c | 33 ++++++++++++++------------------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/Xi/extinit.c b/Xi/extinit.c index 38415f64d..c9f3003d0 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -458,7 +458,7 @@ SProcIDispatch(ClientPtr client) case X_XIUngrabDevice: return ProcXIUngrabDevice(client); case X_XIAllowEvents: - return SProcXIAllowEvents(client); + return ProcXIAllowEvents(client); case X_XIPassiveGrabDevice: return SProcXIPassiveGrabDevice(client); case X_XIPassiveUngrabDevice: diff --git a/Xi/handlers.h b/Xi/handlers.h index c6311dd5c..c7b8babe1 100644 --- a/Xi/handlers.h +++ b/Xi/handlers.h @@ -69,7 +69,6 @@ int ProcXUngrabDeviceButton(ClientPtr client); int ProcXUngrabDevice(ClientPtr client); int ProcXUngrabDeviceKey(ClientPtr client); -int SProcXIAllowEvents(ClientPtr client); int SProcXIBarrierReleasePointer(ClientPtr client); int SProcXIGetClientPointer(ClientPtr client); int SProcXIGetSelectedEvents(ClientPtr client); diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c index 659872631..1422b91c2 100644 --- a/Xi/xiallowev.c +++ b/Xi/xiallowev.c @@ -46,28 +46,23 @@ #include "eventstr.h" #include "exglobals.h" /* BadDevice */ -int _X_COLD -SProcXIAllowEvents(ClientPtr client) -{ - REQUEST(xXIAllowEventsReq); - REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq); - - swaps(&stuff->deviceid); - swapl(&stuff->time); - if (client->req_len > 3) { - xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff; - - REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq); - swapl(&req_xi22->touchid); - swapl(&req_xi22->grab_window); - } - - return ProcXIAllowEvents(client); -} - int ProcXIAllowEvents(ClientPtr client) { + if (client->swapped) { + REQUEST(xXIAllowEventsReq); + REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq); + swaps(&stuff->deviceid); + swapl(&stuff->time); + if (client->req_len > 3) { + xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff; + + REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq); + swapl(&req_xi22->touchid); + swapl(&req_xi22->grab_window); + } + } + Bool have_xi22 = FALSE; CARD32 clientTime; int deviceId;