From cbf1e26a7ef256341b9610ca436cb4d00ca3713f Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 29 Jul 2024 15:01:08 +0200 Subject: [PATCH] (submit/xrandr-swap-fix) randr: fix wrong call to RRGetScreenResources() in swapped case ProcRRGetScreenResources() vs. RRGetScreenResourcesCurrent() have different semantics - this also must be followed in byte-swapped case. Fixes: fc70839431 - Add server support for RRGetScreenResourcesCurrent Signed-off-by: Enrico Weigelt, metux IT consult --- randr/rrsdispatch.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c index 1f29d9d39..627e0c220 100644 --- a/randr/rrsdispatch.c +++ b/randr/rrsdispatch.c @@ -115,6 +115,17 @@ SProcRRGetScreenResources(ClientPtr client) return (*ProcRandrVector[stuff->randrReqType]) (client); } +static int _X_COLD +SProcRRGetScreenResourcesCurrent(ClientPtr client) +{ + REQUEST(xRRGetScreenResourcesCurrentReq); + + REQUEST_SIZE_MATCH(xRRGetScreenResourcesCurrentReq); + swaps(&stuff->length); + swapl(&stuff->window); + return (*ProcRandrVector[stuff->randrReqType]) (client); +} + static int _X_COLD SProcRRGetOutputInfo(ClientPtr client) { @@ -667,7 +678,7 @@ int (*SProcRandrVector[RRNumberRequests]) (ClientPtr) = { SProcRRGetCrtcGamma, /* 23 */ SProcRRSetCrtcGamma, /* 24 */ /* V1.3 additions */ - SProcRRGetScreenResources, /* 25 GetScreenResourcesCurrent */ + SProcRRGetScreenResourcesCurrent, /* 25 */ SProcRRSetCrtcTransform, /* 26 */ SProcRRGetCrtcTransform, /* 27 */ SProcRRGetPanning, /* 28 */