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 seem 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index a8c1d977c7d..884c9588b51 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -223,6 +223,7 @@ struct monitor unsigned int flags; RECT rc_monitor; RECT rc_work; + BOOL is_clone; };
static struct list adapters = LIST_INIT(adapters); @@ -1249,7 +1250,7 @@ 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 ret; @@ -1295,6 +1296,15 @@ static BOOL update_display_cache_from_registry(void) break; }
+ LIST_FOR_EACH_ENTRY(monitor2, &monitors, struct monitor, entry) + { + if (EqualRect(&monitor2->rc_monitor, &monitor->rc_monitor)) + { + monitor->is_clone = TRUE; + break; + } + } + monitor->handle = UlongToHandle( ++monitor_count ); list_add_tail( &monitors, &monitor->entry ); } @@ -2016,6 +2026,7 @@ BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc get_thread_dpi() ); OffsetRect( &monrect, -origin.x, -origin.y ); if (!intersect_rect( &monrect, &monrect, &limit )) continue; + if (monitor->is_clone) continue;
enum_info[count].handle = monitor->handle; enum_info[count].rect = monrect;