From 24f8535f28c736624b0dbbb3cb2889c1183f614c Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 19 Sep 2025 16:10:57 +0200 Subject: [PATCH] Xi: inline SProcXIChangeCursor() 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/xichangecursor.c | 23 +++++++++-------------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Xi/extinit.c b/Xi/extinit.c index d6cfc1c950..878fb0c09a 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -436,7 +436,7 @@ SProcIDispatch(ClientPtr client) case X_XIWarpPointer: return SProcXIWarpPointer(client); case X_XIChangeCursor: - return SProcXIChangeCursor(client); + return ProcXIChangeCursor(client); case X_XIChangeHierarchy: return ProcXIChangeHierarchy(client); case X_XISetClientPointer: diff --git a/Xi/handlers.h b/Xi/handlers.h index d4b0eae74d..ceace12117 100644 --- a/Xi/handlers.h +++ b/Xi/handlers.h @@ -81,7 +81,6 @@ int SProcXGrabDevice(ClientPtr client); int SProcXGrabDeviceKey(ClientPtr client); int SProcXIAllowEvents(ClientPtr client); int SProcXIBarrierReleasePointer(ClientPtr client); -int SProcXIChangeCursor(ClientPtr client); int SProcXIGetClientPointer(ClientPtr client); int SProcXIGetFocus(ClientPtr client); int SProcXIGetSelectedEvents(ClientPtr client); diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c index 95866b4826..e5cf9f862a 100644 --- a/Xi/xichangecursor.c +++ b/Xi/xichangecursor.c @@ -54,28 +54,23 @@ * */ -int _X_COLD -SProcXIChangeCursor(ClientPtr client) -{ - REQUEST(xXIChangeCursorReq); - REQUEST_SIZE_MATCH(xXIChangeCursorReq); - swapl(&stuff->win); - swapl(&stuff->cursor); - swaps(&stuff->deviceid); - return (ProcXIChangeCursor(client)); -} - int ProcXIChangeCursor(ClientPtr client) { + REQUEST(xXIChangeCursorReq); + REQUEST_SIZE_MATCH(xXIChangeCursorReq); + + if (client->swapped) { + swapl(&stuff->win); + swapl(&stuff->cursor); + swaps(&stuff->deviceid); + } + int rc; WindowPtr pWin = NULL; DeviceIntPtr pDev = NULL; CursorPtr pCursor = NULL; - REQUEST(xXIChangeCursorReq); - REQUEST_SIZE_MATCH(xXIChangeCursorReq); - rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess); if (rc != Success) return rc;