diff --git a/abstract_client.cpp b/abstract_client.cpp index 5800f89654..3c83fc95fb 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -64,10 +64,6 @@ AbstractClient::AbstractClient() #endif , m_colorScheme(QStringLiteral("kdeglobals")) { - connect(this, &AbstractClient::geometryShapeChanged, this, &AbstractClient::geometryChanged); - auto signalMaximizeChanged = static_cast(&AbstractClient::clientMaximizedStateChanged); - connect(this, signalMaximizeChanged, this, &AbstractClient::geometryChanged); - connect(this, &AbstractClient::clientStepUserMovedResized, this, &AbstractClient::geometryChanged); connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::moveResizedChanged); connect(this, &AbstractClient::clientFinishUserMovedResized, this, &AbstractClient::moveResizedChanged); connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::removeCheckScreenConnection); @@ -89,7 +85,7 @@ AbstractClient::AbstractClient() }); // replace on-screen-display on size changes - connect(this, &AbstractClient::geometryShapeChanged, this, + connect(this, &AbstractClient::frameGeometryChanged, this, [this] (Toplevel *c, const QRect &old) { Q_UNUSED(c) if (isOnScreenDisplay() && !frameGeometry().isEmpty() && old.size() != frameGeometry().size() && !isInitialPositionSet()) { @@ -821,9 +817,9 @@ void AbstractClient::move(int x, int y, ForceGeometry_t force) screens()->setCurrent(this); workspace()->updateStackingOrder(); // client itself is not damaged + emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking()); addRepaintDuringGeometryUpdates(); updateGeometryBeforeUpdateBlocking(); - emit geometryChanged(); } bool AbstractClient::startMoveResize() @@ -1430,7 +1426,7 @@ void AbstractClient::setupWindowManagementInterface() w->setParentWindow(transientFor() ? transientFor()->windowManagementInterface() : nullptr); } ); - connect(this, &AbstractClient::geometryChanged, w, + connect(this, &AbstractClient::frameGeometryChanged, w, [w, this] { w->setGeometry(frameGeometry()); } diff --git a/abstract_client.h b/abstract_client.h index 0356d7af70..e07c1b87c2 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -220,8 +220,8 @@ class KWIN_EXPORT AbstractClient : public Toplevel Q_PROPERTY(bool modal READ isModal NOTIFY modalChanged) /** - * The geometry of this Client. Be aware that depending on resize mode the geometryChanged signal - * might be emitted at each resize step or only at the end of the resize operation. + * The geometry of this Client. Be aware that depending on resize mode the frameGeometryChanged + * signal might be emitted at each resize step or only at the end of the resize operation. */ Q_PROPERTY(QRect geometry READ frameGeometry WRITE setFrameGeometry) diff --git a/autotests/integration/activation_test.cpp b/autotests/integration/activation_test.cpp index e0e74c238c..fc93140360 100644 --- a/autotests/integration/activation_test.cpp +++ b/autotests/integration/activation_test.cpp @@ -381,11 +381,11 @@ void ActivationTest::testSwitchToWindowMaximized() QVERIFY(configureRequestedSpy1.wait()); workspace()->slotWindowMaximize(); QVERIFY(configureRequestedSpy1.wait()); - QSignalSpy geometryChangedSpy1(client1, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy1.isValid()); + QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy1.isValid()); shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value()); Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red); - QVERIFY(geometryChangedSpy1.wait()); + QVERIFY(frameGeometryChangedSpy1.wait()); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); @@ -396,11 +396,11 @@ void ActivationTest::testSwitchToWindowMaximized() QVERIFY(configureRequestedSpy2.wait()); workspace()->slotWindowMaximize(); QVERIFY(configureRequestedSpy2.wait()); - QSignalSpy geometryChangedSpy2(client2, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy2.isValid()); + QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy2.isValid()); shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value()); Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red); - QVERIFY(geometryChangedSpy2.wait()); + QVERIFY(frameGeometryChangedSpy2.wait()); const QList stackingOrder = workspace()->stackingOrder(); QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2)); @@ -466,11 +466,11 @@ void ActivationTest::testSwitchToWindowFullScreen() QVERIFY(configureRequestedSpy1.wait()); workspace()->slotWindowFullScreen(); QVERIFY(configureRequestedSpy1.wait()); - QSignalSpy geometryChangedSpy1(client1, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy1.isValid()); + QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy1.isValid()); shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value()); Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red); - QVERIFY(geometryChangedSpy1.wait()); + QVERIFY(frameGeometryChangedSpy1.wait()); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); @@ -481,11 +481,11 @@ void ActivationTest::testSwitchToWindowFullScreen() QVERIFY(configureRequestedSpy2.wait()); workspace()->slotWindowFullScreen(); QVERIFY(configureRequestedSpy2.wait()); - QSignalSpy geometryChangedSpy2(client2, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy2.isValid()); + QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy2.isValid()); shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value()); Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red); - QVERIFY(geometryChangedSpy2.wait()); + QVERIFY(frameGeometryChangedSpy2.wait()); const QList stackingOrder = workspace()->stackingOrder(); QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2)); diff --git a/autotests/integration/effects/maximize_animation_test.cpp b/autotests/integration/effects/maximize_animation_test.cpp index bccb41198d..5d0f75607f 100644 --- a/autotests/integration/effects/maximize_animation_test.cpp +++ b/autotests/integration/effects/maximize_animation_test.cpp @@ -157,8 +157,8 @@ void MaximizeAnimationTest::testMaximizeRestore() QVERIFY(!effect->isActive()); // Maximize the client. - QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy maximizeChangedSpy(client, qOverload(&XdgShellClient::clientMaximizedStateChanged)); QVERIFY(maximizeChangedSpy.isValid()); @@ -173,8 +173,8 @@ void MaximizeAnimationTest::testMaximizeRestore() // Draw contents of the maximized client. shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(1280, 1024), Qt::red); - QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(geometryChangedSpy.count(), 2); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 1); QCOMPARE(maximizeChangedSpy.count(), 1); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); QVERIFY(effect->isActive()); @@ -194,8 +194,8 @@ void MaximizeAnimationTest::testMaximizeRestore() // Draw contents of the restored client. shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(100, 50), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(geometryChangedSpy.count(), 4); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 2); QCOMPARE(maximizeChangedSpy.count(), 2); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); QVERIFY(effect->isActive()); diff --git a/autotests/integration/maximize_test.cpp b/autotests/integration/maximize_test.cpp index 1dd1ab22e4..4f3a164877 100644 --- a/autotests/integration/maximize_test.cpp +++ b/autotests/integration/maximize_test.cpp @@ -133,8 +133,8 @@ void TestMaximized::testMaximizedPassedToDeco() QVERIFY(bordersChangedSpy.isValid()); QSignalSpy maximizedChangedSpy(decoration->client().data(), &KDecoration2::DecoratedClient::maximizedChanged); QVERIFY(maximizedChangedSpy.isValid()); - QSignalSpy geometryShapeChangedSpy(client, &AbstractClient::geometryShapeChanged); - QVERIFY(geometryShapeChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); workspace()->slotWindowMaximize(); QVERIFY(configureRequestedSpy.wait()); @@ -142,10 +142,10 @@ void TestMaximized::testMaximizedPassedToDeco() QCOMPARE(configureRequestedSpy.last().at(0).toSize(), QSize(1280, 1024 - decoration->borderTop())); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), configureRequestedSpy.last().at(0).toSize(), Qt::red); - QVERIFY(geometryShapeChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); // If no borders, there is only the initial geometry shape change, but none through border resizing. - QCOMPARE(geometryShapeChangedSpy.count(), hasBorders ? 2 : 1); + QCOMPARE(frameGeometryChangedSpy.count(), hasBorders ? 2 : 1); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); QCOMPARE(maximizedChangedSpy.count(), 1); QCOMPARE(maximizedChangedSpy.last().first().toBool(), true); @@ -163,8 +163,8 @@ void TestMaximized::testMaximizedPassedToDeco() shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(100, 50), Qt::red); - QVERIFY(geometryShapeChangedSpy.wait()); - QCOMPARE(geometryShapeChangedSpy.count(), hasBorders ? 4 : 2); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), hasBorders ? 4 : 2); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); QCOMPARE(maximizedChangedSpy.count(), 2); QCOMPARE(maximizedChangedSpy.last().first().toBool(), false); @@ -273,11 +273,11 @@ void TestMaximized::testBorderlessMaximizedWindow() QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(1280, 1024), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); @@ -294,7 +294,7 @@ void TestMaximized::testBorderlessMaximizedWindow() shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(100, 50), Qt::red); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry(), maximizeRestoreGeometry); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); @@ -326,8 +326,8 @@ void TestMaximized::testBorderlessMaximizedWindowNoClientSideDecoration() auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); - QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy sizeChangeRequestedSpy(xdgShellSurface.data(), &XdgShellSurface::sizeChanged); QVERIFY(sizeChangeRequestedSpy.isValid()); QSignalSpy configureRequestedSpy(xdgShellSurface.data(), &XdgShellSurface::configureRequested); @@ -348,7 +348,7 @@ void TestMaximized::testBorderlessMaximizedWindowNoClientSideDecoration() xdgShellSurface->ackConfigure(it[2].toInt()); } Test::render(surface.data(), sizeChangeRequestedSpy.last().first().toSize(), Qt::red); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); // no deco QVERIFY(!client->isDecorated()); @@ -365,7 +365,7 @@ void TestMaximized::testBorderlessMaximizedWindowNoClientSideDecoration() xdgShellSurface->ackConfigure(it[2].toInt()); } Test::render(surface.data(), sizeChangeRequestedSpy.last().first().toSize(), Qt::red); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QVERIFY(client->isDecorated()); QVERIFY(!client->noBorder()); diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp index b36deed8e9..f7ef81f54e 100644 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -138,8 +138,6 @@ void MoveResizeWindowTest::testMove() QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); - QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); QVERIFY(startMoveResizedSpy.isValid()); QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged); @@ -243,8 +241,8 @@ void MoveResizeWindowTest::testResize() QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); - QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); QVERIFY(startMoveResizedSpy.isValid()); QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged); @@ -289,7 +287,7 @@ void MoveResizeWindowTest::testResize() // Now render new size. shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(108, 50), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 50)); QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); @@ -310,7 +308,7 @@ void MoveResizeWindowTest::testResize() // Now render new size. shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(108, 58), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 58)); QCOMPARE(clientStepUserMovedResizedSpy.count(), 2); @@ -487,10 +485,10 @@ void MoveResizeWindowTest::testGrowShrink() QVERIFY(sizeChangeSpy.wait()); Test::render(surface.data(), shellSurface->size(), Qt::red); - QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); m_connection->flush(); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QTEST(c->frameGeometry(), "expectedGeometry"); } @@ -920,8 +918,8 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard() QVERIFY(configureRequestedSpy.wait()); client->move(100, 300); - QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); @@ -930,7 +928,7 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard() shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); // render at the new size Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); client->setVirtualKeyboardGeometry(QRect()); @@ -939,7 +937,7 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard() shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); // render at the new size Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); } @@ -963,8 +961,8 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize() QVERIFY(configureRequestedSpy.wait()); client->move(100, 300); - QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); @@ -973,14 +971,14 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize() shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); // render at the new size Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); client->setMaximize(true, true); QVERIFY(configureRequestedSpy.wait()); shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); client->setVirtualKeyboardGeometry(QRect()); @@ -988,7 +986,7 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize() // render at the size of the configureRequested.. it won't have changed Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); - QVERIFY(!geometryChangedSpy.wait(10)); + QVERIFY(!frameGeometryChangedSpy.wait(10)); // Size will NOT be restored QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); @@ -1014,8 +1012,8 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen() QVERIFY(configureRequestedSpy.wait()); client->move(100, 300); - QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); @@ -1024,14 +1022,14 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen() shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); // render at the new size Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); client->setFullScreen(true, true); QVERIFY(configureRequestedSpy.wait()); shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); client->setVirtualKeyboardGeometry(QRect()); @@ -1039,7 +1037,7 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen() // render at the size of the configureRequested.. it won't have changed Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); - QVERIFY(!geometryChangedSpy.wait(10)); + QVERIFY(!frameGeometryChangedSpy.wait(10)); // Size will NOT be restored QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); } diff --git a/autotests/integration/plasma_surface_test.cpp b/autotests/integration/plasma_surface_test.cpp index faf2e905ea..60aef48fcd 100644 --- a/autotests/integration/plasma_surface_test.cpp +++ b/autotests/integration/plasma_surface_test.cpp @@ -241,10 +241,10 @@ void PlasmaSurfaceTest::testOSDPlacement() QCOMPARE(c->frameGeometry(), QRect(590, 649, 100, 50)); // change size of window - QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryShapeChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); Test::render(surface.data(), QSize(200, 100), Qt::red); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(c->frameGeometry(), QRect(540, 616, 200, 100)); } diff --git a/autotests/integration/quick_tiling_test.cpp b/autotests/integration/quick_tiling_test.cpp index 15016c570f..7bbc0c7ee4 100644 --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -180,8 +180,8 @@ void QuickTilingTest::testQuickTiling() QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); QVERIFY(quickTileChangedSpy.isValid()); - QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QFETCH(QuickTileMode, mode); QFETCH(QRect, expectedGeometry); @@ -202,9 +202,8 @@ void QuickTilingTest::testQuickTiling() shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), expectedGeometry.size(), Qt::red); - QVERIFY(geometryChangedSpy.wait()); - QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue); - QCOMPARE(geometryChangedSpy.count(), 1); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 1); QCOMPARE(c->frameGeometry(), expectedGeometry); // send window to other screen @@ -257,8 +256,8 @@ void QuickTilingTest::testQuickMaximizing() QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); QVERIFY(quickTileChangedSpy.isValid()); - QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy maximizeChangedSpy1(c, qOverload(&AbstractClient::clientMaximizedStateChanged)); QVERIFY(maximizeChangedSpy1.isValid()); QSignalSpy maximizeChangedSpy2(c, qOverload(&AbstractClient::clientMaximizedStateChanged)); @@ -283,8 +282,8 @@ void QuickTilingTest::testQuickMaximizing() shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(1280, 1024), Qt::red); - QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(geometryChangedSpy.count(), 2); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 1); QCOMPARE(c->frameGeometry(), QRect(0, 0, 1280, 1024)); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); @@ -316,8 +315,8 @@ void QuickTilingTest::testQuickMaximizing() shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(100, 50), Qt::yellow); - QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(geometryChangedSpy.count(), 4); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 2); QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); QCOMPARE(maximizeChangedSpy1.count(), 2); @@ -782,14 +781,14 @@ void QuickTilingTest::testShortcut() QCOMPARE(configureRequestedSpy.last().at(0).toSize(), expectedGeometry.size()); // attach a new image - QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), expectedGeometry.size(), Qt::red); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue); - QCOMPARE(geometryChangedSpy.count(), 1); + QCOMPARE(frameGeometryChangedSpy.count(), 1); QCOMPARE(c->frameGeometry(), expectedGeometry); } @@ -837,8 +836,8 @@ void QuickTilingTest::testScript() QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); QVERIFY(quickTileChangedSpy.isValid()); - QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QVERIFY(Scripting::self()); QTemporaryFile tmpFile; @@ -881,9 +880,9 @@ void QuickTilingTest::testScript() shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), expectedGeometry.size(), Qt::red); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue); - QCOMPARE(geometryChangedSpy.count(), 1); + QCOMPARE(frameGeometryChangedSpy.count(), 1); QCOMPARE(c->frameGeometry(), expectedGeometry); } diff --git a/autotests/integration/struts_test.cpp b/autotests/integration/struts_test.cpp index a1b887ff97..8a2a7d9903 100644 --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -246,10 +246,10 @@ void StrutsTest::testMoveWaylandPanel() QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024)); QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1000)); - QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryShapeChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); plasmaSurface->setPosition(QPoint(1280, 1000)); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(c->frameGeometry(), QRect(1280, 1000, 1280, 24)); QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1024)); QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1024)); diff --git a/autotests/integration/transient_placement.cpp b/autotests/integration/transient_placement.cpp index 7a4e1b388d..368395714b 100644 --- a/autotests/integration/transient_placement.cpp +++ b/autotests/integration/transient_placement.cpp @@ -340,10 +340,10 @@ void TransientPlacementTest::testXdgPopupWithPanel() parent->setFullScreen(true); QVERIFY(fullscreenSpy.wait()); parentShellSurface->ackConfigure(fullscreenSpy.first().at(2).value()); - QSignalSpy geometryShapeChangedSpy{parent, &XdgShellClient::geometryShapeChanged}; - QVERIFY(geometryShapeChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy{parent, &XdgShellClient::frameGeometryChanged}; + QVERIFY(frameGeometryChangedSpy.isValid()); Test::render(parentSurface, fullscreenSpy.first().at(0).toSize(), Qt::red); - QVERIFY(geometryShapeChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(parent->frameGeometry(), screens()->geometry(0)); QVERIFY(parent->isFullScreen()); diff --git a/autotests/integration/xdgshellclient_rules_test.cpp b/autotests/integration/xdgshellclient_rules_test.cpp index 52bd1c4ad0..46dfc81b13 100644 --- a/autotests/integration/xdgshellclient_rules_test.cpp +++ b/autotests/integration/xdgshellclient_rules_test.cpp @@ -579,10 +579,10 @@ void TestXdgShellClientRules::testPositionApplyNow() RuleBook::self()->setConfig(config); // The client should be moved to the position specified by the rule. - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); workspace()->slotReconfigure(); - QCOMPARE(geometryChangedSpy.count(), 1); + QCOMPARE(frameGeometryChangedSpy.count(), 1); QCOMPARE(client->pos(), QPoint(42, 42)); // We still have to be able to move the client around. @@ -792,8 +792,8 @@ void TestXdgShellClientRules::testSizeApply() QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); // One still should be able to resize the client. - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); QVERIFY(clientStartMoveResizedSpy.isValid()); QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized); @@ -832,7 +832,7 @@ void TestXdgShellClientRules::testSizeApply() QCOMPARE(clientStepUserMovedResizedSpy.count(), 0); shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); Test::render(surface.data(), QSize(488, 640), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->size(), QSize(488, 640)); QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); @@ -930,8 +930,8 @@ void TestXdgShellClientRules::testSizeRemember() QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); // One should still be able to resize the client. - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); QVERIFY(clientStartMoveResizedSpy.isValid()); QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized); @@ -970,7 +970,7 @@ void TestXdgShellClientRules::testSizeRemember() QCOMPARE(clientStepUserMovedResizedSpy.count(), 0); shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); Test::render(surface.data(), QSize(488, 640), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->size(), QSize(488, 640)); QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); @@ -1154,11 +1154,11 @@ void TestXdgShellClientRules::testSizeApplyNow() QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640)); // Draw the surface with the new size. - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); Test::render(surface.data(), QSize(480, 640), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->size(), QSize(480, 640)); QVERIFY(!configureRequestedSpy->wait(100)); @@ -1387,11 +1387,11 @@ void TestXdgShellClientRules::testMaximizeApply() QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); Test::render(surface.data(), QSize(100, 50), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->size(), QSize(100, 50)); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); @@ -1499,11 +1499,11 @@ void TestXdgShellClientRules::testMaximizeRemember() QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); Test::render(surface.data(), QSize(100, 50), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->size(), QSize(100, 50)); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); @@ -1713,11 +1713,11 @@ void TestXdgShellClientRules::testMaximizeApplyNow() QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); // Draw contents of the maximized client. - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); Test::render(surface.data(), QSize(1280, 1024), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->size(), QSize(1280, 1024)); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); @@ -1736,7 +1736,7 @@ void TestXdgShellClientRules::testMaximizeApplyNow() shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); Test::render(surface.data(), QSize(100, 50), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->size(), QSize(100, 50)); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp index 25234b9a91..4593066352 100644 --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -461,8 +461,8 @@ void TestXdgShellClient::testFullscreen() QCOMPARE(c->sizeForClientSize(c->clientSize()), c->frameGeometry().size()); QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged); QVERIFY(fullscreenChangedSpy.isValid()); - QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy sizeChangeRequestedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); QVERIFY(sizeChangeRequestedSpy.isValid()); QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); @@ -476,12 +476,12 @@ void TestXdgShellClient::testFullscreen() // TODO: should switch to fullscreen once it's updated QVERIFY(c->isFullScreen()); QCOMPARE(c->clientSize(), QSize(100, 50)); - QVERIFY(geometryChangedSpy.isEmpty()); + QVERIFY(frameGeometryChangedSpy.isEmpty()); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), sizeChangeRequestedSpy.first().first().toSize(), Qt::red); - QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(geometryChangedSpy.count(), 1); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 1); QVERIFY(c->isFullScreen()); QVERIFY(!c->isDecorated()); QCOMPARE(c->frameGeometry(), QRect(QPoint(0, 0), sizeChangeRequestedSpy.first().first().toSize())); @@ -537,8 +537,8 @@ void TestXdgShellClient::testFullscreenRestore() QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged); QVERIFY(fullscreenChangedSpy.isValid()); - QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); // swap back to normal configureRequestedSpy.clear(); @@ -554,8 +554,8 @@ void TestXdgShellClient::testFullscreenRestore() } Test::render(surface.data(), QSize(100, 50), Qt::red); - QVERIFY(geometryChangedSpy.wait()); - QCOMPARE(geometryChangedSpy.count(), 1); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 1); QVERIFY(!c->isFullScreen()); QCOMPARE(c->frameGeometry().size(), QSize(100, 50)); } @@ -680,8 +680,8 @@ void TestXdgShellClient::testMaximizedToFullscreen() QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server); QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged); QVERIFY(fullscreenChangedSpy.isValid()); - QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy sizeChangeRequestedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); QVERIFY(sizeChangeRequestedSpy.isValid()); QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); @@ -692,11 +692,11 @@ void TestXdgShellClient::testMaximizedToFullscreen() shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), sizeChangeRequestedSpy.last().first().toSize(), Qt::red); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(c->maximizeMode(), MaximizeFull); - QCOMPARE(geometryChangedSpy.isEmpty(), false); - geometryChangedSpy.clear(); + QCOMPARE(frameGeometryChangedSpy.isEmpty(), false); + frameGeometryChangedSpy.clear(); // fullscreen the window shellSurface->setFullscreen(true); @@ -1318,10 +1318,10 @@ void TestXdgShellClient::testXdgWindowGeometryIsntSet() const QPoint oldPosition = client->pos(); - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); Test::render(surface.data(), QSize(100, 50), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry().topLeft(), oldPosition); QCOMPARE(client->frameGeometry().size(), QSize(100, 50)); QCOMPARE(client->bufferGeometry().topLeft(), oldPosition); @@ -1333,7 +1333,7 @@ void TestXdgShellClient::testXdgWindowGeometryIsntSet() subSurface->setPosition(QPoint(-20, -10)); Test::render(childSurface.data(), QSize(100, 50), Qt::blue); surface->commit(Surface::CommitFlag::None); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry().topLeft(), oldPosition); QCOMPARE(client->frameGeometry().size(), QSize(120, 60)); QCOMPARE(client->bufferGeometry().topLeft(), oldPosition + QPoint(20, 10)); @@ -1356,27 +1356,29 @@ void TestXdgShellClient::testXdgWindowGeometryAttachBuffer() const QPoint oldPosition = client->pos(); - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->setWindowGeometry(QRect(10, 10, 180, 80)); surface->commit(Surface::CommitFlag::None); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 1); QCOMPARE(client->frameGeometry().topLeft(), oldPosition); QCOMPARE(client->frameGeometry().size(), QSize(180, 80)); QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(10, 10)); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); Test::render(surface.data(), QSize(100, 50), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 2); QCOMPARE(client->frameGeometry().topLeft(), oldPosition); - QEXPECT_FAIL("", "Ask on wayland-devel what effective window geometry should be here", Continue); - QCOMPARE(client->frameGeometry().size(), QSize(180, 80)); + QCOMPARE(client->frameGeometry().size(), QSize(100, 50)); QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(10, 10)); QCOMPARE(client->bufferGeometry().size(), QSize(100, 50)); shellSurface->setWindowGeometry(QRect(5, 5, 90, 40)); surface->commit(Surface::CommitFlag::None); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); + QCOMPARE(frameGeometryChangedSpy.count(), 3); QCOMPARE(client->frameGeometry().topLeft(), oldPosition); QCOMPARE(client->frameGeometry().size(), QSize(90, 40)); QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(5, 5)); @@ -1401,11 +1403,11 @@ void TestXdgShellClient::testXdgWindowGeometryAttachSubSurface() const QPoint oldPosition = client->pos(); - QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->setWindowGeometry(QRect(10, 10, 180, 80)); surface->commit(Surface::CommitFlag::None); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry().topLeft(), oldPosition); QCOMPARE(client->frameGeometry().size(), QSize(180, 80)); QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(10, 10)); @@ -1424,7 +1426,7 @@ void TestXdgShellClient::testXdgWindowGeometryAttachSubSurface() shellSurface->setWindowGeometry(QRect(-15, -15, 50, 40)); surface->commit(Surface::CommitFlag::None); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->frameGeometry().topLeft(), oldPosition); QCOMPARE(client->frameGeometry().size(), QSize(50, 40)); QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(-15, -15)); @@ -1449,11 +1451,11 @@ void TestXdgShellClient::testXdgWindowGeometryInteractiveResize() QVERIFY(configureRequestedSpy.wait()); QCOMPARE(configureRequestedSpy.count(), 1); - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->setWindowGeometry(QRect(10, 10, 180, 80)); surface->commit(Surface::CommitFlag::None); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); QCOMPARE(client->frameGeometry().size(), QSize(180, 80)); @@ -1487,7 +1489,7 @@ void TestXdgShellClient::testXdgWindowGeometryInteractiveResize() shellSurface->setWindowGeometry(QRect(10, 10, 188, 80)); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(208, 100), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); QCOMPARE(client->bufferGeometry().size(), QSize(208, 100)); QCOMPARE(client->frameGeometry().size(), QSize(188, 80)); @@ -1505,7 +1507,7 @@ void TestXdgShellClient::testXdgWindowGeometryInteractiveResize() shellSurface->setWindowGeometry(QRect(10, 10, 188, 88)); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(208, 108), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(clientStepUserMovedResizedSpy.count(), 2); QCOMPARE(client->bufferGeometry().size(), QSize(208, 108)); QCOMPARE(client->frameGeometry().size(), QSize(188, 88)); @@ -1544,11 +1546,11 @@ void TestXdgShellClient::testXdgWindowGeometryFullScreen() QVERIFY(configureRequestedSpy.wait()); QCOMPARE(configureRequestedSpy.count(), 1); - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->setWindowGeometry(QRect(10, 10, 180, 80)); surface->commit(Surface::CommitFlag::None); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); QCOMPARE(client->frameGeometry().size(), QSize(180, 80)); @@ -1561,7 +1563,7 @@ void TestXdgShellClient::testXdgWindowGeometryFullScreen() shellSurface->setWindowGeometry(QRect(0, 0, 1280, 1024)); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(1280, 1024), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->bufferGeometry().size(), QSize(1280, 1024)); QCOMPARE(client->frameGeometry().size(), QSize(1280, 1024)); @@ -1574,7 +1576,7 @@ void TestXdgShellClient::testXdgWindowGeometryFullScreen() shellSurface->setWindowGeometry(QRect(10, 10, 180, 80)); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(200, 100), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); QCOMPARE(client->frameGeometry().size(), QSize(180, 80)); @@ -1600,11 +1602,11 @@ void TestXdgShellClient::testXdgWindowGeometryMaximize() QVERIFY(configureRequestedSpy.wait()); QCOMPARE(configureRequestedSpy.count(), 1); - QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); - QVERIFY(geometryChangedSpy.isValid()); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); + QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->setWindowGeometry(QRect(10, 10, 180, 80)); surface->commit(Surface::CommitFlag::None); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); QCOMPARE(client->frameGeometry().size(), QSize(180, 80)); @@ -1617,7 +1619,7 @@ void TestXdgShellClient::testXdgWindowGeometryMaximize() shellSurface->setWindowGeometry(QRect(0, 0, 1280, 1024)); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(1280, 1024), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->bufferGeometry().size(), QSize(1280, 1024)); QCOMPARE(client->frameGeometry().size(), QSize(1280, 1024)); @@ -1630,7 +1632,7 @@ void TestXdgShellClient::testXdgWindowGeometryMaximize() shellSurface->setWindowGeometry(QRect(10, 10, 180, 80)); shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); Test::render(surface.data(), QSize(200, 100), Qt::blue); - QVERIFY(geometryChangedSpy.wait()); + QVERIFY(frameGeometryChangedSpy.wait()); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); QCOMPARE(client->frameGeometry().size(), QSize(180, 80)); diff --git a/decorations/decoratedclient.cpp b/decorations/decoratedclient.cpp index 6e150d8043..3637f3a41f 100644 --- a/decorations/decoratedclient.cpp +++ b/decorations/decoratedclient.cpp @@ -54,7 +54,7 @@ DecoratedClientImpl::DecoratedClientImpl(AbstractClient *client, KDecoration2::D emit decoratedClient->activeChanged(client->isActive()); } ); - connect(client, &AbstractClient::geometryChanged, this, + connect(client, &AbstractClient::frameGeometryChanged, this, [decoratedClient, this]() { if (m_client->clientSize() == m_clientSize) { return; diff --git a/events.cpp b/events.cpp index 0b919646fa..0cd659a58c 100644 --- a/events.cpp +++ b/events.cpp @@ -1312,7 +1312,7 @@ void Unmanaged::configureNotifyEvent(xcb_configure_notify_event_t *e) addWorkspaceRepaint(visibleRect()); // damage old area QRect old = m_frameGeometry; m_frameGeometry = newgeom; - emit geometryChanged(); // update shadow region + emit frameGeometryChanged(this, old); // update shadow region addRepaintFull(); if (old.size() != m_frameGeometry.size()) discardWindowPixmap(); diff --git a/internal_client.cpp b/internal_client.cpp index 4695914f46..76b45f5730 100644 --- a/internal_client.cpp +++ b/internal_client.cpp @@ -628,9 +628,11 @@ void InternalClient::commitGeometry(const QRect &rect) addWorkspaceRepaint(visibleRect()); syncGeometryToInternalWindow(); - const QRect oldGeometry = frameGeometryBeforeUpdateBlocking(); + if (frameGeometryBeforeUpdateBlocking() != frameGeometry()) { + emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking()); + } + emit geometryShapeChanged(this, frameGeometryBeforeUpdateBlocking()); updateGeometryBeforeUpdateBlocking(); - emit geometryShapeChanged(this, oldGeometry); if (isResize()) { performMoveResize(); diff --git a/pointer_input.cpp b/pointer_input.cpp index a2dfdac05e..386a0238e0 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -503,7 +503,7 @@ void PointerInputRedirection::cleanupDecoration(Decoration::DecoratedClientImpl QCoreApplication::instance()->sendEvent(now->decoration(), &event); now->client()->processDecorationMove(pos.toPoint(), m_pos.toPoint()); - m_decorationGeometryConnection = connect(decoration()->client(), &AbstractClient::geometryChanged, this, + m_decorationGeometryConnection = connect(decoration()->client(), &AbstractClient::frameGeometryChanged, this, [this] { // ensure maximize button gets the leave event when maximizing/restore a window, see BUG 385140 const auto oldDeco = decoration(); @@ -565,7 +565,7 @@ void PointerInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow seat->setPointerPos(m_pos.toPoint()); seat->setFocusedPointerSurface(focusNow->surface(), focusNow->inputTransformation()); - m_focusGeometryConnection = connect(focusNow, &Toplevel::geometryChanged, this, + m_focusGeometryConnection = connect(focusNow, &Toplevel::frameGeometryChanged, this, [this] { // TODO: why no assert possible? if (!focus()) { diff --git a/shadow.cpp b/shadow.cpp index 745c4bb689..85e9b2f46b 100644 --- a/shadow.cpp +++ b/shadow.cpp @@ -47,7 +47,7 @@ Shadow::Shadow(Toplevel *toplevel) , m_cachedSize(toplevel->size()) , m_decorationShadow(nullptr) { - connect(m_topLevel, SIGNAL(geometryChanged()), SLOT(geometryChanged())); + connect(m_topLevel, &Toplevel::frameGeometryChanged, this, &Shadow::geometryChanged); } Shadow::~Shadow() @@ -445,7 +445,7 @@ bool Shadow::updateShadow() void Shadow::setToplevel(Toplevel *topLevel) { m_topLevel = topLevel; - connect(m_topLevel, SIGNAL(geometryChanged()), SLOT(geometryChanged())); + connect(m_topLevel, &Toplevel::frameGeometryChanged, this, &Shadow::geometryChanged); } void Shadow::geometryChanged() { diff --git a/toplevel.cpp b/toplevel.cpp index 56d4668f9e..387a8a50f4 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -59,6 +59,9 @@ Toplevel::Toplevel() connect(screens(), SIGNAL(changed()), SLOT(checkScreen())); connect(screens(), SIGNAL(countChanged(int,int)), SLOT(checkScreen())); setupCheckScreenConnection(); + + // Only for compatibility reasons, drop in the next major release. + connect(this, &Toplevel::frameGeometryChanged, this, &Toplevel::geometryChanged); } Toplevel::~Toplevel() @@ -517,15 +520,13 @@ void Toplevel::checkScreen() void Toplevel::setupCheckScreenConnection() { - connect(this, SIGNAL(geometryShapeChanged(KWin::Toplevel*,QRect)), SLOT(checkScreen())); - connect(this, SIGNAL(geometryChanged()), SLOT(checkScreen())); + connect(this, &Toplevel::frameGeometryChanged, this, &Toplevel::checkScreen); checkScreen(); } void Toplevel::removeCheckScreenConnection() { - disconnect(this, SIGNAL(geometryShapeChanged(KWin::Toplevel*,QRect)), this, SLOT(checkScreen())); - disconnect(this, SIGNAL(geometryChanged()), this, SLOT(checkScreen())); + disconnect(this, &Toplevel::frameGeometryChanged, this, &Toplevel::checkScreen); } int Toplevel::screen() const diff --git a/toplevel.h b/toplevel.h index 2cf6bbc0ee..b5c43dab64 100644 --- a/toplevel.h +++ b/toplevel.h @@ -78,20 +78,20 @@ class KWIN_EXPORT Toplevel : public QObject * * @deprecated Use frameGeometry property instead. */ - Q_PROPERTY(QRect geometry READ frameGeometry NOTIFY geometryChanged) + Q_PROPERTY(QRect geometry READ frameGeometry NOTIFY frameGeometryChanged) /** * This property holds rectangle that the pixmap or buffer of this Toplevel * occupies on the screen. This rectangle includes invisible portions of the * client, e.g. client-side drop shadows, etc. */ - Q_PROPERTY(QRect bufferGeometry READ bufferGeometry NOTIFY geometryChanged) + Q_PROPERTY(QRect bufferGeometry READ bufferGeometry) /** * This property holds the geometry of the Toplevel, excluding invisible * portions, e.g. server-side and client-side drop-shadows, etc. */ - Q_PROPERTY(QRect frameGeometry READ frameGeometry NOTIFY geometryChanged) + Q_PROPERTY(QRect frameGeometry READ frameGeometry NOTIFY frameGeometryChanged) /** * This property holds the position of the Toplevel's frame geometry. @@ -589,6 +589,10 @@ public: Q_SIGNALS: void opacityChanged(KWin::Toplevel* toplevel, qreal oldOpacity); void damaged(KWin::Toplevel* toplevel, const QRect& damage); + /** + * This signal is emitted when the Toplevel's frame geometry changes. + * @deprecated since 5.19, use frameGeometryChanged instead + */ void geometryChanged(); void geometryShapeChanged(KWin::Toplevel* toplevel, const QRect& old); void paddingChanged(KWin::Toplevel* toplevel, const QRect& old); @@ -652,6 +656,11 @@ Q_SIGNALS: */ void shadowChanged(); + /** + * This signal is emitted when the Toplevel's frame geometry changes. + */ + void frameGeometryChanged(KWin::Toplevel *toplevel, const QRect &oldGeometry); + protected Q_SLOTS: /** * Checks whether the screen number for this Toplevel changed and updates if needed. diff --git a/touch_input.cpp b/touch_input.cpp index eec38e772f..22ff287e91 100644 --- a/touch_input.cpp +++ b/touch_input.cpp @@ -118,7 +118,7 @@ void TouchInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow) // FIXME: add input transformation API to KWayland::Server::SeatInterface for touch input seat->setFocusedTouchSurface(focusNow->surface(), -1 * focusNow->inputTransformation().map(focusNow->pos()) + focusNow->pos()); - m_focusGeometryConnection = connect(focusNow, &Toplevel::geometryChanged, this, + m_focusGeometryConnection = connect(focusNow, &Toplevel::frameGeometryChanged, this, [this] { if (focus().isNull()) { return; diff --git a/unmanaged.cpp b/unmanaged.cpp index bc89874947..529eb5f1b3 100644 --- a/unmanaged.cpp +++ b/unmanaged.cpp @@ -45,7 +45,6 @@ const NET::WindowTypes SUPPORTED_UNMANAGED_WINDOW_TYPES_MASK = NET::NormalMask | Unmanaged::Unmanaged() : Toplevel() { - connect(this, SIGNAL(geometryShapeChanged(KWin::Toplevel*,QRect)), SIGNAL(geometryChanged())); QTimer::singleShot(50, this, SLOT(setReadyForPainting())); } diff --git a/x11client.cpp b/x11client.cpp index 079d91a694..b83d820461 100644 --- a/x11client.cpp +++ b/x11client.cpp @@ -2762,7 +2762,7 @@ void X11Client::readShowOnScreenEdge(Xcb::Property &property) hideClient(true); successfullyHidden = isHiddenInternal(); - m_edgeGeometryTrackingConnection = connect(this, &X11Client::geometryChanged, this, [this, border](){ + m_edgeGeometryTrackingConnection = connect(this, &X11Client::frameGeometryChanged, this, [this, border](){ hideClient(true); ScreenEdges::self()->reserve(this, border); }); @@ -2908,9 +2908,11 @@ void X11Client::move(int x, int y, ForceGeometry_t force) screens()->setCurrent(this); workspace()->updateStackingOrder(); // client itself is not damaged + if (frameGeometryBeforeUpdateBlocking() != frameGeometry()) { + emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking()); + } addRepaintDuringGeometryUpdates(); updateGeometryBeforeUpdateBlocking(); - emit geometryChanged(); } bool X11Client::belongToSameApplication(const X11Client *c1, const X11Client *c2, SameApplicationChecks checks) @@ -4208,11 +4210,12 @@ void X11Client::setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t for if (bufferGeometryBeforeUpdateBlocking().size() != m_bufferGeometry.size()) { discardWindowPixmap(); } + if (frameGeometryBeforeUpdateBlocking() != m_frameGeometry) { + emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking()); + } emit geometryShapeChanged(this, frameGeometryBeforeUpdateBlocking()); addRepaintDuringGeometryUpdates(); updateGeometryBeforeUpdateBlocking(); - // TODO: this signal is emitted too often - emit geometryChanged(); } void X11Client::plainResize(int w, int h, ForceGeometry_t force) @@ -4264,11 +4267,12 @@ void X11Client::plainResize(int w, int h, ForceGeometry_t force) if (bufferGeometryBeforeUpdateBlocking().size() != m_bufferGeometry.size()) { discardWindowPixmap(); } + if (frameGeometryBeforeUpdateBlocking() != frameGeometry()) { + emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking()); + } emit geometryShapeChanged(this, frameGeometryBeforeUpdateBlocking()); addRepaintDuringGeometryUpdates(); updateGeometryBeforeUpdateBlocking(); - // TODO: this signal is emitted too often - emit geometryChanged(); } void X11Client::updateServerGeometry() diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index f7a4068136..07992de3dc 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -153,7 +153,7 @@ void XdgShellClient::init() connect(this, &AbstractClient::clientStartUserMovedResized, this, configure); connect(this, &AbstractClient::clientFinishUserMovedResized, this, configure); - connect(this, &XdgShellClient::geometryChanged, this, &XdgShellClient::updateClientOutputs); + connect(this, &XdgShellClient::frameGeometryChanged, this, &XdgShellClient::updateClientOutputs); connect(screens(), &Screens::changed, this, &XdgShellClient::updateClientOutputs); } else if (m_xdgShellPopup) { connect(m_xdgShellPopup, &XdgShellPopupInterface::configureAcknowledged, this, &XdgShellClient::handleConfigureAcknowledged); @@ -579,12 +579,13 @@ void XdgShellClient::doSetGeometry(const QRect &rect) workspace()->updateClientArea(); } updateWindowRules(Rules::Position | Rules::Size); + emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking()); } - const auto old = frameGeometryBeforeUpdateBlocking(); + emit geometryShapeChanged(this, frameGeometryBeforeUpdateBlocking()); + addRepaintDuringGeometryUpdates(); updateGeometryBeforeUpdateBlocking(); - emit geometryShapeChanged(this, old); if (isResize()) { performMoveResize(); @@ -1443,7 +1444,7 @@ void XdgShellClient::installPlasmaShellSurface(PlasmaShellSurfaceInterface *surf updatePosition(); updateRole(); updateShowOnScreenEdge(); - connect(this, &XdgShellClient::geometryChanged, this, &XdgShellClient::updateShowOnScreenEdge); + connect(this, &XdgShellClient::frameGeometryChanged, this, &XdgShellClient::updateShowOnScreenEdge); setSkipTaskbar(surface->skipTaskbar()); connect(surface, &PlasmaShellSurfaceInterface::skipTaskbarChanged, this, [this] {