From ac8e03419eae132bd26aca4a1769bed6df87d057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 22 Mar 2023 23:43:52 +0800 Subject: [PATCH] DisplayServer (Windows): correct resolution for vertical modes --- .../displayserver/displayserver_windows.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/detection/displayserver/displayserver_windows.c b/src/detection/displayserver/displayserver_windows.c index 4c8601b0d..9c9f27984 100644 --- a/src/detection/displayserver/displayserver_windows.c +++ b/src/detection/displayserver/displayserver_windows.c @@ -87,9 +87,19 @@ static void detectDisplays(FFDisplayServerResult* ds, bool detectName) } } + uint32_t width = modes[path->sourceInfo.modeInfoIdx].sourceMode.width; + uint32_t height = modes[path->sourceInfo.modeInfoIdx].sourceMode.height; + if (path->targetInfo.rotation == DISPLAYCONFIG_ROTATION_ROTATE90 || + path->targetInfo.rotation == DISPLAYCONFIG_ROTATION_ROTATE270) + { + uint32_t temp = width; + width = height; + height = temp; + } + ffdsAppendDisplay(ds, - modes[path->sourceInfo.modeInfoIdx].sourceMode.width, - modes[path->sourceInfo.modeInfoIdx].sourceMode.height, + width, + height, path->targetInfo.refreshRate.Numerator / (double) path->targetInfo.refreshRate.Denominator, data.width, data.height,