diff --git a/autotests/wayland/quick_tiling_test.cpp b/autotests/wayland/quick_tiling_test.cpp index b81f892fc1..2ab3afec9c 100644 --- a/autotests/wayland/quick_tiling_test.cpp +++ b/autotests/wayland/quick_tiling_test.cpp @@ -151,20 +151,21 @@ void QuickTilingTest::testQuickTiling_data() { QTest::addColumn("mode"); QTest::addColumn("expectedGeometry"); + QTest::addColumn("secondScreen"); #define FLAG(name) AbstractClient::QuickTileMode(AbstractClient::QuickTile##name) - QTest::newRow("left") << FLAG(Left) << QRect(0, 0, 640, 1024); - QTest::newRow("top") << FLAG(Top) << QRect(0, 0, 1280, 512); - QTest::newRow("right") << FLAG(Right) << QRect(640, 0, 640, 1024); - QTest::newRow("bottom") << FLAG(Bottom) << QRect(0, 512, 1280, 512); + QTest::newRow("left") << FLAG(Left) << QRect(0, 0, 640, 1024) << QRect(1280, 0, 640, 1024); + QTest::newRow("top") << FLAG(Top) << QRect(0, 0, 1280, 512) << QRect(1280, 0, 1280, 512); + QTest::newRow("right") << FLAG(Right) << QRect(640, 0, 640, 1024) << QRect(1920, 0, 640, 1024); + QTest::newRow("bottom") << FLAG(Bottom) << QRect(0, 512, 1280, 512) << QRect(1280, 512, 1280, 512); - QTest::newRow("top left") << (FLAG(Left) | FLAG(Top)) << QRect(0, 0, 640, 512); - QTest::newRow("top right") << (FLAG(Right) | FLAG(Top)) << QRect(640, 0, 640, 512); - QTest::newRow("bottom left") << (FLAG(Left) | FLAG(Bottom)) << QRect(0, 512, 640, 512); - QTest::newRow("bottom right") << (FLAG(Right) | FLAG(Bottom)) << QRect(640, 512, 640, 512); + QTest::newRow("top left") << (FLAG(Left) | FLAG(Top)) << QRect(0, 0, 640, 512) << QRect(1280, 0, 640, 512); + QTest::newRow("top right") << (FLAG(Right) | FLAG(Top)) << QRect(640, 0, 640, 512) << QRect(1920, 0, 640, 512); + QTest::newRow("bottom left") << (FLAG(Left) | FLAG(Bottom)) << QRect(0, 512, 640, 512) << QRect(1280, 512, 640, 512); + QTest::newRow("bottom right") << (FLAG(Right) | FLAG(Bottom)) << QRect(640, 512, 640, 512) << QRect(1920, 512, 640, 512); - QTest::newRow("maximize") << FLAG(Maximize) << QRect(0, 0, 1280, 1024); + QTest::newRow("maximize") << FLAG(Maximize) << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024); #undef FLAG } @@ -227,6 +228,15 @@ void QuickTilingTest::testQuickTiling() QVERIFY(geometryChangedSpy.wait()); QCOMPARE(geometryChangedSpy.count(), 1); QCOMPARE(c->geometry(), expectedGeometry); + + // send window to other screen + QCOMPARE(c->screen(), 0); + c->sendToScreen(1); + QCOMPARE(c->screen(), 1); + // quick tile should not be changed + QEXPECT_FAIL("maximize", "Maximize loses the state", Continue); + QCOMPARE(c->quickTileMode(), mode); + QTEST(c->geometry(), "secondScreen"); } void QuickTilingTest::testQuickMaximizing_data() diff --git a/shell_client.cpp b/shell_client.cpp index 1c9af37419..6c4af4b60a 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -254,7 +254,13 @@ void ShellClient::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) { Q_UNUSED(force) // TODO: better merge with Client's implementation - requestGeometry(QRect(x, y, w, h)); + if (QSize(w, h) == geom.size()) { + // size didn't change, update directly + doSetGeometry(QRect(x, y, w, h)); + } else { + // size did change, Client needs to provide a new buffer + requestGeometry(QRect(x, y, w, h)); + } } void ShellClient::doSetGeometry(const QRect &rect)