From fe7c5ab7e9b5933a82e26e8e93589e557234d338 Mon Sep 17 00:00:00 2001
From: akallabeth <akallabeth@posteo.net>
Date: Thu, 29 Jan 2026 22:04:15 +0100
Subject: [PATCH 1/3] [core,settings] improve rdpMonitor log

stringify the orientation value in the log message.
---
 libfreerdp/core/settings.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c
index 993670e7b32f..5a3a65856204 100644
--- a/libfreerdp/core/settings.c
+++ b/libfreerdp/core/settings.c
@@ -36,6 +36,7 @@
 
 #include <freerdp/version.h>
 #include <freerdp/settings.h>
+#include <freerdp/utils/string.h>
 #include <freerdp/utils/helpers.h>
 #include <freerdp/build-config.h>
 
@@ -567,10 +568,12 @@ static void log_monitor(UINT32 idx, const rdpMonitor* monitor, wLog* log, DWORD
 
 	WLog_Print(log, level,
 	           "[%" PRIu32 "] [%s] {%dx%d-%dx%d} [%" PRIu32 "] {%" PRIu32 "x%" PRIu32
-	           ", orientation: %" PRIu32 ", desktopScale: %" PRIu32 ", deviceScale: %" PRIu32 "}",
+	           ", orientation: %s [%" PRIu32 "], desktopScale: %" PRIu32 ", deviceScale: %" PRIu32
+	           "}",
 	           idx, monitor->is_primary ? "primary" : "       ", monitor->x, monitor->y,
 	           monitor->width, monitor->height, monitor->orig_screen,
 	           monitor->attributes.physicalWidth, monitor->attributes.physicalHeight,
+	           freerdp_desktop_rotation_flags_to_string(monitor->attributes.orientation),
 	           monitor->attributes.orientation, monitor->attributes.desktopScaleFactor,
 	           monitor->attributes.deviceScaleFactor);
 }

From 0a8ab5724d3155132b04a89e0c1a79396fc62878 Mon Sep 17 00:00:00 2001
From: Armin Novak <armin.novak@thincast.com>
Date: Thu, 29 Jan 2026 12:49:37 +0100
Subject: [PATCH 2/3] [utils] fix typo in doxygen

---
 include/freerdp/utils/rdpdr_utils.h | 2 +-
 include/freerdp/utils/string.h      | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/freerdp/utils/rdpdr_utils.h b/include/freerdp/utils/rdpdr_utils.h
index 185a0a32fa57..4d1022782e33 100644
--- a/include/freerdp/utils/rdpdr_utils.h
+++ b/include/freerdp/utils/rdpdr_utils.h
@@ -107,7 +107,7 @@ extern "C"
 	 *  @param type The value to convert
 	 *  @return A constant string representation of \ref type or the string \b
 	 * UNKNOWN for an invalid value
-	 *  @since verstion 3.22.0
+	 *  @since version 3.22.0
 	 */
 	FREERDP_API WINPR_ATTR_NODISCARD const char* rdpdr_device_type_string(UINT32 type);
 
diff --git a/include/freerdp/utils/string.h b/include/freerdp/utils/string.h
index c6a252b519eb..883d72241f61 100644
--- a/include/freerdp/utils/string.h
+++ b/include/freerdp/utils/string.h
@@ -55,7 +55,7 @@ extern "C"
 	 *  @param flags The value to convert
 	 *  @return A constant string representation of \ref flags or the string \b ORIENTATION_UNKNOWN
 	 * for an invalid value
-	 *  @since verstion 3.22.0
+	 *  @since version 3.22.0
 	 */
 	FREERDP_API WINPR_ATTR_NODISCARD const char*
 	freerdp_desktop_rotation_flags_to_string(UINT32 flags);
@@ -65,7 +65,7 @@ extern "C"
 	 *  @param flags The value to convert
 	 *  @return A constant string representation of \ref flag or the string \b
 	 * RDPINPUT_CONTACT_FLAG_UNKNOWN for an invalid value
-	 *  @since verstion 3.22.0
+	 *  @since version 3.22.0
 	 */
 	FREERDP_API WINPR_ATTR_NODISCARD const char* freerdp_input_touch_state_string(DWORD flags);
 
@@ -74,7 +74,7 @@ extern "C"
 	 *  @param type The value to convert
 	 *  @return A constant string representation of \ref type or the string \b
 	 * UNKNOWN for an invalid value
-	 *  @since verstion 3.22.0
+	 *  @since version 3.22.0
 	 */
 	FREERDP_API WINPR_ATTR_NODISCARD const char* freerdp_order_support_flags_string(UINT8 type);
 

From 123be8e0095532f055e072d655a52f1ce7f6c244 Mon Sep 17 00:00:00 2001
From: akallabeth <akallabeth@posteo.net>
Date: Thu, 29 Jan 2026 22:19:05 +0100
Subject: [PATCH 3/3] [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 9db8371c7fad..fa6e903b5f10 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
