From 123be8e0095532f055e072d655a52f1ce7f6c244 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 29 Jan 2026 22:19:05 +0100 Subject: [PATCH] [client,x11] fix orientation setting of rdpMonitor --- client/X11/xf_monitor.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/client/X11/xf_monitor.c b/client/X11/xf_monitor.c index 9db8371c7..fa6e903b5 100644 --- a/client/X11/xf_monitor.c +++ b/client/X11/xf_monitor.c @@ -465,7 +465,23 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) attrs->physicalHeight = WINPR_ASSERTING_INT_CAST(uint32_t, rrmonitors[i].mheight); ret = XRRRotations(xfc->display, WINPR_ASSERTING_INT_CAST(int, i), &rot); - attrs->orientation = ret; + switch (rot & ret) + { + + case RR_Rotate_90: + attrs->orientation = ORIENTATION_PORTRAIT; + break; + case RR_Rotate_180: + attrs->orientation = ORIENTATION_LANDSCAPE_FLIPPED; + break; + case RR_Rotate_270: + attrs->orientation = ORIENTATION_PORTRAIT_FLIPPED; + break; + case RR_Rotate_0: + default: + attrs->orientation = ORIENTATION_LANDSCAPE; + break; + } } #endif