From: Zhiyi Zhang <zzhang(a)codeweavers.com> DMDO_DEFAULT is the natural orientation of the device, which isn't necessarily a horizontal mode. --- dlls/win32u/sysparams.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index df3f9aa639b..15c85a44e13 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1610,9 +1610,14 @@ static DEVMODEW *get_virtual_modes( const DEVMODEW *current, const DEVMODEW *ini {2560, 1600} }; UINT depths[] = {8, 16, initial->dmBitsPerPel}, i, j, count; - BOOL vertical = initial->dmDisplayOrientation & 1; + BOOL vertical; DEVMODEW *modes; + /* Check the ratio of dmPelsWidth to dmPelsHeight to determine whether the initial display mode + * is in horizontal or vertical orientation. DMDO_DEFAULT is the natural orientation of the + * device, which isn't necessarily a horizontal mode */ + vertical = initial->dmPelsHeight > initial->dmPelsWidth; + modes = malloc( ARRAY_SIZE(depths) * (ARRAY_SIZE(screen_sizes) + 2) * sizeof(*modes) ); for (count = i = 0; modes && i < ARRAY_SIZE(depths); ++i) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7002