Commit 793e4640 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

win32u: Don't enumerate mirrored monitor clones for GetSystemMetrics(SM_CMONITORS).

Only one monitor in a mirrored monitor set contributes to the result of GetSystemMetrics(SM_CMONITORS). Tested manually on Win7 and Win10.
parent 6505403e
......@@ -3348,15 +3348,15 @@ struct monitor_enum_info
RECT rect;
};
static unsigned int active_monitor_count(void)
static unsigned int active_unique_monitor_count(void)
{
struct monitor *monitor;
unsigned int count = 0;
LIST_FOR_EACH_ENTRY(monitor, &monitors, struct monitor, entry)
{
if (!is_monitor_active( monitor )) continue;
count++;
if (is_monitor_active( monitor ) && !monitor->is_clone)
count++;
}
return count;
}
......@@ -5941,7 +5941,7 @@ int get_system_metrics( int index )
return rect.bottom - rect.top;
case SM_CMONITORS:
if (!lock_display_devices()) return FALSE;
ret = active_monitor_count();
ret = active_unique_monitor_count();
unlock_display_devices();
return ret;
case SM_SAMEDISPLAYFORMAT:
......
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