[PATCH] user32: Don't report mirrored slave monitors in EnumDisplayMonitors.
Mirrored slave monitors don't get enumerated by EnumDisplayMonitors. For example, if two monitors are in mirrored mode, only one of them is reported by EnumDisplayMonitors. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> --- dlls/user32/sysparams.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 09cebc2f62..b407b51811 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -3750,7 +3750,8 @@ static BOOL update_monitor_cache(void) HANDLE mutex = NULL; DWORD state_flags; BOOL ret = FALSE; - DWORD i = 0; + BOOL mirrored_slave; + DWORD i = 0, j; DWORD type; /* Update monitor cache from SetupAPI if it's outdated */ @@ -3794,6 +3795,20 @@ static BOOL update_monitor_cache(void) if (!SetupDiGetDevicePropertyW( devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_RCMONITOR, &type, (BYTE *)&monitors[monitor_count].rcMonitor, sizeof(RECT), NULL, 0 )) goto fail; + + /* Mirrored slave monitors also don't get enumerated */ + mirrored_slave = FALSE; + for (j = 0; j < monitor_count; j++) + { + if (EqualRect(&monitors[j].rcMonitor, &monitors[monitor_count].rcMonitor)) + { + mirrored_slave = TRUE; + break; + } + } + if (mirrored_slave) + continue; + if (!SetupDiGetDevicePropertyW( devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_RCWORK, &type, (BYTE *)&monitors[monitor_count].rcWork, sizeof(RECT), NULL, 0 )) goto fail; -- 2.23.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=56476 Your paranoid android. === debian10 (32 bit report) === user32: msg.c:5148: Test succeeded inside todo block: ShowWindow(SW_SHOWMINIMIZED):overlapped: marked "todo_wine" but succeeds Report errors: user32:msg prints too much data (35221 bytes) === debian10 (32 bit Chinese:China report) === user32: msg.c:5148: Test succeeded inside todo block: ShowWindow(SW_SHOWMINIMIZED):overlapped: marked "todo_wine" but succeeds Report errors: user32:msg prints too much data (35221 bytes) === debian10 (32 bit WoW report) === user32: msg.c:5148: Test succeeded inside todo block: ShowWindow(SW_SHOWMINIMIZED):overlapped: marked "todo_wine" but succeeds Report errors: user32:msg prints too much data (35223 bytes) === debian10 (64 bit WoW report) === user32: msg.c:5148: Test succeeded inside todo block: ShowWindow(SW_SHOWMINIMIZED):overlapped: marked "todo_wine" but succeeds Report errors: user32:msg prints too much data (35221 bytes)
participants (2)
-
Marvin -
Zhiyi Zhang