win32u: Fix a possible condition that makes EnumDisplayMonitors() not reporting any monitors.
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.
This commit is contained in:
parent
1600f2e6bd
commit
6505403e58
1 changed files with 3 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue