Commit 6b2b004c authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32/tests: Fix test failures on multiple monitor setup.

The desktop window rectangle is the same as that of primary monitor for compatibility reasons. It equals to virtual screen rectangle only when there are no more than two active and non-mirrored monitors. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 227d5a32
......@@ -3225,6 +3225,7 @@ static void test_dpi_mapping(void)
ULONG_PTR i, j, k;
WINDOWPLACEMENT wpl_orig, wpl;
HMONITOR monitor;
INT monitor_count;
MONITORINFO mon_info;
DPI_AWARENESS_CONTEXT context;
......@@ -3235,6 +3236,7 @@ static void test_dpi_mapping(void)
}
context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
GetWindowRect( GetDesktopWindow(), &desktop );
monitor_count = GetSystemMetrics( SM_CMONITORS );
for (i = DPI_AWARENESS_UNAWARE; i <= DPI_AWARENESS_PER_MONITOR_AWARE; i++)
{
pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
......@@ -3247,9 +3249,12 @@ static void test_dpi_mapping(void)
SetRect( &rect, 0, 0, GetSystemMetrics( SM_CXSCREEN ), GetSystemMetrics( SM_CYSCREEN ));
ok( EqualRect( &expect, &rect ), "%lu: wrong desktop rect %s expected %s\n",
i, wine_dbgstr_rect(&rect), wine_dbgstr_rect(&expect) );
if (monitor_count < 2)
{
SetRect( &rect, 0, 0, GetSystemMetrics( SM_CXVIRTUALSCREEN ), GetSystemMetrics( SM_CYVIRTUALSCREEN ));
ok( EqualRect( &expect, &rect ), "%lu: wrong virt desktop rect %s expected %s\n",
i, wine_dbgstr_rect(&rect), wine_dbgstr_rect(&expect) );
}
SetRect( &rect, 0, 0, 1, 1 );
monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
ok( monitor != 0, "failed to get monitor\n" );
......
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