user32/tests: Fix a ChangeDisplaySettings() test.
Overlapped monitor rectangles should be automatically adjusted to avoid overlaps. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
4369aaae57
commit
1bb2b16042
|
@ -757,26 +757,35 @@ static void test_ChangeDisplaySettingsEx(void)
|
|||
|
||||
if (res)
|
||||
{
|
||||
/* The secondary adapter should be to the right of the primary adapter */
|
||||
todo_wine ok(dm2.dmPosition.x == dm.dmPosition.x + dm.dmPelsWidth,
|
||||
"Expected dm2.dmPosition.x %d, got %d.\n", dm.dmPosition.x + dm.dmPelsWidth,
|
||||
dm2.dmPosition.x);
|
||||
ok(dm2.dmPosition.y == dm.dmPosition.y, "Expected dm2.dmPosition.y %d, got %d.\n",
|
||||
dm.dmPosition.y, dm2.dmPosition.y);
|
||||
|
||||
/* Test position conflict */
|
||||
dm2.dmPosition.x = dm.dmPosition.x;
|
||||
dm2.dmPosition.x = dm.dmPosition.x - dm2.dmPelsWidth + 1;
|
||||
dm2.dmPosition.y = dm.dmPosition.y;
|
||||
res = ChangeDisplaySettingsExA(devices[1].name, &dm2, NULL, CDS_RESET, NULL);
|
||||
ok(res == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExA %s returned unexpected %d\n", devices[1].name, res);
|
||||
|
||||
/* Position is not changed even if ChangeDisplaySettingsExA returned DISP_CHANGE_SUCCESSFUL */
|
||||
/* Position is changed and automatically moved */
|
||||
memset(&dm2, 0, sizeof(dm2));
|
||||
dm2.dmSize = sizeof(dm2);
|
||||
res = EnumDisplaySettingsA(devices[1].name, ENUM_CURRENT_SETTINGS, &dm2);
|
||||
ok(res, "EnumDisplaySettingsA %s failed, error %#x\n", devices[1].name, GetLastError());
|
||||
todo_wine ok(dm2.dmPosition.x != dm.dmPosition.x, "Expect position change not applied.\n");
|
||||
todo_wine ok((dm2.dmPosition.x == dm.dmPosition.x - dm2.dmPelsWidth),
|
||||
"Expected dmPosition.x %d, got %d.\n", dm.dmPosition.x - dm2.dmPelsWidth,
|
||||
dm2.dmPosition.x);
|
||||
|
||||
/* Test position with extra space. The extra space will be removed */
|
||||
dm2.dmPosition.x = dm.dmPosition.x - dm2.dmPelsWidth - dm2.dmPelsWidth / 2;
|
||||
dm2.dmPosition.x = dm.dmPosition.x + dm.dmPelsWidth + 1;
|
||||
dm2.dmPosition.y = dm.dmPosition.y;
|
||||
res = ChangeDisplaySettingsExA(devices[1].name, &dm2, NULL, CDS_RESET, NULL);
|
||||
ok(res == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsExA %s returned unexpected %d\n", devices[1].name, res);
|
||||
|
||||
dm2.dmPosition.x = dm.dmPosition.x - dm2.dmPelsWidth;
|
||||
dm2.dmPosition.x = dm.dmPosition.x + dm.dmPelsWidth;
|
||||
expect_dm(dm2, devices[1].name, 0);
|
||||
|
||||
/* Test placing the secondary adapter to all sides of the primary adapter */
|
||||
|
|
Loading…
Reference in New Issue