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 diff --git a/include/freerdp/utils/rdpdr_utils.h b/include/freerdp/utils/rdpdr_utils.h index 185a0a32f..4d1022782 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 c6a252b51..883d72241 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); diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index 993670e7b..5a3a65856 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -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); }