Commit af8ed02b authored by Arkadiusz Hiler's avatar Arkadiusz Hiler Committed by Alexandre Julliard

win32u: Don't report cloned monitors in EnumDisplayMonitors().

Based on: ca39b1c2 ("user32: Don't report mirrored slave monitors in EnumDisplayMonitors.") 2affb854 ("user32: Change slave to a more neutral word.") Which seem to got lost during: 31867340 ("win32u: Move NtUserEnumDisplayMonitors implementation from user32.") Fixes regression with Elite Dangerous launcher freezing when cloned displays are present. Signed-off-by: 's avatarArkadiusz Hiler <ahiler@codeweavers.com>
parent 754378ba
...@@ -223,6 +223,7 @@ struct monitor ...@@ -223,6 +223,7 @@ struct monitor
unsigned int flags; unsigned int flags;
RECT rc_monitor; RECT rc_monitor;
RECT rc_work; RECT rc_work;
BOOL is_clone;
}; };
static struct list adapters = LIST_INIT(adapters); static struct list adapters = LIST_INIT(adapters);
...@@ -1249,7 +1250,7 @@ static BOOL update_display_cache_from_registry(void) ...@@ -1249,7 +1250,7 @@ static BOOL update_display_cache_from_registry(void)
DWORD adapter_id, monitor_id, monitor_count = 0, size; DWORD adapter_id, monitor_id, monitor_count = 0, size;
KEY_BASIC_INFORMATION key; KEY_BASIC_INFORMATION key;
struct adapter *adapter; struct adapter *adapter;
struct monitor *monitor; struct monitor *monitor, *monitor2;
HANDLE mutex = NULL; HANDLE mutex = NULL;
NTSTATUS status; NTSTATUS status;
BOOL ret; BOOL ret;
...@@ -1295,6 +1296,15 @@ static BOOL update_display_cache_from_registry(void) ...@@ -1295,6 +1296,15 @@ static BOOL update_display_cache_from_registry(void)
break; 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 ); monitor->handle = UlongToHandle( ++monitor_count );
list_add_tail( &monitors, &monitor->entry ); list_add_tail( &monitors, &monitor->entry );
} }
...@@ -2016,6 +2026,7 @@ BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc ...@@ -2016,6 +2026,7 @@ BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc
get_thread_dpi() ); get_thread_dpi() );
OffsetRect( &monrect, -origin.x, -origin.y ); OffsetRect( &monrect, -origin.x, -origin.y );
if (!intersect_rect( &monrect, &monrect, &limit )) continue; if (!intersect_rect( &monrect, &monrect, &limit )) continue;
if (monitor->is_clone) continue;
enum_info[count].handle = monitor->handle; enum_info[count].handle = monitor->handle;
enum_info[count].rect = monrect; enum_info[count].rect = monrect;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment