Module: wine Branch: master Commit: 793e4640e49d367906c4a9e7f35c46bf3df6a5b9 URL: https://gitlab.winehq.org/wine/wine/-/commit/793e4640e49d367906c4a9e7f35c46b...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Fri Mar 15 10:50:40 2024 +0800
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.
---
dlls/win32u/sysparams.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index d2f7396971b..6e638922629 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -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: