Based on: ca39b1c22dfa ("user32: Don't report mirrored slave monitors in EnumDisplayMonitors.") 2affb854e524 ("user32: Change slave to a more neutral word.")
Which seems to got lost during: 318673405c62 ("win32u: Move NtUserEnumDisplayMonitors implementation from user32.")
Fixes regression with Elite Dangerous launcher freezing when cloned displays are present.
Signed-off-by: Arkadiusz Hiler ahiler@codeweavers.com
CC: @zhiyi @jacek
From: Arkadiusz Hiler ahiler@codeweavers.com
Based on: ca39b1c22dfa ("user32: Don't report mirrored slave monitors in EnumDisplayMonitors.") 2affb854e524 ("user32: Change slave to a more neutral word.")
Which seems to got lost during: 318673405c62 ("win32u: Move NtUserEnumDisplayMonitors implementation from user32.")
Fixes regression with Elite Dangerous launcher freezing when cloned displays are present.
Signed-off-by: Arkadiusz Hiler ahiler@codeweavers.com --- dlls/win32u/sysparams.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index a8c1d977c7d..3a83452cf16 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1249,9 +1249,10 @@ static BOOL update_display_cache_from_registry(void) DWORD adapter_id, monitor_id, monitor_count = 0, size; KEY_BASIC_INFORMATION key; struct adapter *adapter; - struct monitor *monitor; + struct monitor *monitor, *monitor2; HANDLE mutex = NULL; NTSTATUS status; + BOOL is_cloned; BOOL ret;
/* If user driver did initialize the registry, then exit */ @@ -1295,6 +1296,19 @@ static BOOL update_display_cache_from_registry(void) break; }
+ is_cloned = FALSE; + LIST_FOR_EACH_ENTRY(monitor2, &monitors, struct monitor, entry) + { + if (EqualRect(&monitor2->rc_monitor, &monitor->rc_monitor)) + { + is_cloned = TRUE; + break; + } + } + + if (is_cloned) + continue; + monitor->handle = UlongToHandle( ++monitor_count ); list_add_tail( &monitors, &monitor->entry ); }
Zhiyi Zhang (@zhiyi) commented about dlls/win32u/sysparams.c:
break; }
is_cloned = FALSE;
LIST_FOR_EACH_ENTRY(monitor2, &monitors, struct monitor, entry)
{
if (EqualRect(&monitor2->rc_monitor, &monitor->rc_monitor))
{
is_cloned = TRUE;
break;
}
}
if (is_cloned)
continue;
If the monitor to be added is the last monitor and is a cloned replica, this will leak the monitor pointer.