diff --git a/abstract_client.h b/abstract_client.h --- a/abstract_client.h +++ b/abstract_client.h @@ -220,8 +220,8 @@ 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/abstract_client.cpp b/abstract_client.cpp --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -64,10 +64,6 @@ #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 @@ }); // 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 @@ 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 @@ w->setParentWindow(transientFor() ? transientFor()->windowManagementInterface() : nullptr); } ); - connect(this, &AbstractClient::geometryChanged, w, + connect(this, &AbstractClient::frameGeometryChanged, w, [w, this] { w->setGeometry(frameGeometry()); } diff --git a/autotests/integration/activation_test.cpp b/autotests/integration/activation_test.cpp --- a/autotests/integration/activation_test.cpp +++ b/autotests/integration/activation_test.cpp @@ -381,11 +381,11 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/effects/maximize_animation_test.cpp +++ b/autotests/integration/effects/maximize_animation_test.cpp @@ -157,8 +157,8 @@ 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 @@ // 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 @@ // 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 --- a/autotests/integration/maximize_test.cpp +++ b/autotests/integration/maximize_test.cpp @@ -133,19 +133,19 @@ 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()); QCOMPARE(configureRequestedSpy.count(), 2); 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -138,8 +138,6 @@ 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 @@ 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 @@ // 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 @@ // 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 @@ 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,26 +918,26 @@ 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)); QVERIFY(configureRequestedSpy.wait()); 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()); QVERIFY(configureRequestedSpy.wait()); 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,32 +961,32 @@ 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)); QVERIFY(configureRequestedSpy.wait()); 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()); QVERIFY(!configureRequestedSpy.wait(10)); // 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,32 +1012,32 @@ 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)); QVERIFY(configureRequestedSpy.wait()); 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()); QVERIFY(!configureRequestedSpy.wait(10)); // 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 --- a/autotests/integration/plasma_surface_test.cpp +++ b/autotests/integration/plasma_surface_test.cpp @@ -241,10 +241,10 @@ 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 --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -180,8 +180,8 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -246,10 +246,10 @@ 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 --- a/autotests/integration/transient_placement.cpp +++ b/autotests/integration/transient_placement.cpp @@ -340,10 +340,10 @@ 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 --- a/autotests/integration/xdgshellclient_rules_test.cpp +++ b/autotests/integration/xdgshellclient_rules_test.cpp @@ -579,10 +579,10 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -461,8 +461,8 @@ 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 @@ // 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 @@ 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 @@ } 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/decorations/decoratedclient.cpp +++ b/decorations/decoratedclient.cpp @@ -54,7 +54,7 @@ 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 --- a/events.cpp +++ b/events.cpp @@ -1312,7 +1312,7 @@ 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 --- a/internal_client.cpp +++ b/internal_client.cpp @@ -628,9 +628,11 @@ 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 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -503,7 +503,7 @@ 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 @@ 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 --- a/shadow.cpp +++ b/shadow.cpp @@ -47,7 +47,7 @@ , 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 @@ 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.h b/toplevel.h --- a/toplevel.h +++ b/toplevel.h @@ -78,20 +78,20 @@ * * @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 @@ 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 @@ */ 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/toplevel.cpp b/toplevel.cpp --- a/toplevel.cpp +++ b/toplevel.cpp @@ -59,6 +59,9 @@ 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::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/touch_input.cpp b/touch_input.cpp --- a/touch_input.cpp +++ b/touch_input.cpp @@ -118,7 +118,7 @@ // 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 --- a/unmanaged.cpp +++ b/unmanaged.cpp @@ -45,7 +45,6 @@ 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 --- a/x11client.cpp +++ b/x11client.cpp @@ -2762,7 +2762,7 @@ 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 @@ 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 @@ 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 @@ 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 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -153,7 +153,7 @@ 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 @@ 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 @@ 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] {