From: Zhiyi Zhang <zzhang(a)codeweavers.com> When there are two monitors and they are mirrored, both of them are considered primary. When the first primary monitor happens to be a clone, EnumDisplayMonitors() ends up not reporting any monitors because should_enumerate_monitor() returns FALSE and we break out the loop to enumerate primary monitors after that. This is a regression from b59619d and my review comments. My indent was to break out of the loop after finding the *master* primary monitor, not cloned primary monitors, to avoid unnecessary iterations. However, the primary monitor count is small and it's cleaner this way so let's break when should_enumerate_monitor() returns TRUE. --- dlls/win32u/sysparams.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 7cefb3822a3..d2f7396971b 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -3459,8 +3459,10 @@ BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc { if (!is_monitor_primary( monitor )) continue; if (should_enumerate_monitor( monitor, &origin, &limit, &enum_info[count].rect )) + { enum_info[count++].handle = monitor->handle; - break; + break; + } } /* then non-primary monitors */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5317