Overlapped monitor rectangles should be automatically adjusted to avoid overlaps.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/user32/tests/monitor.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index 080f040c3f2..05e70c4b625 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -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 */