Commit 15af09c7 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Introduce Toplevel::frameGeometryChanged signal

Summary:
Currently we have two signals that are emitted when the Toplevel's geometry
changes - geometryShapeChanged() and geometryChanged(). The former signal
is used primarily to invalidate cached window quads and the latter is
sort of emitted when the frame geometry changes. But it's not that easy. We
have a bunch of connects that link those signals together...

The worst part about all of this is that the window quads cache gets
invalidated every time a geometry update occurs, for example when user
moves a window around on the screen.

This change introduces a new signal and deprecates the existing geometryChanged
signal. frameGeometryChanged is similar to geometryChanged except that it is
emitted when an _actual_ geometry change has occurred.

We do still emit geometryShapeChanged signal. However, in long term, we
need to get rid of this signal or come up with something that makes sense
and doesn't require us to waste computational resources.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26863
parent dd96e444
......@@ -64,10 +64,6 @@ AbstractClient::AbstractClient()
#endif
, m_colorScheme(QStringLiteral("kdeglobals"))
{
connect(this, &AbstractClient::geometryShapeChanged, this, &AbstractClient::geometryChanged);
auto signalMaximizeChanged = static_cast<void (AbstractClient::*)(KWin::AbstractClient*, MaximizeMode)>(&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());
}
......
......@@ -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)
......
......@@ -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<quint32>());
Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red);
QVERIFY(geometryChangedSpy1.wait());
QVERIFY(frameGeometryChangedSpy1.wait());
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<quint32>());
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
QVERIFY(geometryChangedSpy2.wait());
QVERIFY(frameGeometryChangedSpy2.wait());
const QList<Toplevel *> 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<quint32>());
Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red);
QVERIFY(geometryChangedSpy1.wait());
QVERIFY(frameGeometryChangedSpy1.wait());
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<quint32>());
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
QVERIFY(geometryChangedSpy2.wait());
QVERIFY(frameGeometryChangedSpy2.wait());
const QList<Toplevel *> stackingOrder = workspace()->stackingOrder();
QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2));
......
......@@ -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<AbstractClient *, bool, bool>(&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<quint32>());
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<quint32>());
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());
......
......@@ -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<quint32>());
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<quint32>());
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<quint32>());
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<quint32>());
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());
......
......@@ -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<quint32>());
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<quint32>());
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));
}
......
......@@ -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));
}
......
......@@ -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<quint32>());
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 *, MaximizeMode>(&AbstractClient::clientMaximizedStateChanged));
QVERIFY(maximizeChangedSpy1.isValid());
QSignalSpy maximizeChangedSpy2(c, qOverload<AbstractClient *, bool, bool>(&AbstractClient::clientMaximizedStateChanged));
......@@ -283,8 +282,8 @@ void QuickTilingTest::testQuickMaximizing()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
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<quint32>());
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<quint32>());
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<quint32>());
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);
}
......
......@@ -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));
......
......@@ -340,10 +340,10 @@ void TransientPlacementTest::testXdgPopupWithPanel()
parent->setFullScreen(true);
QVERIFY(fullscreenSpy.wait());
parentShellSurface->ackConfigure(fullscreenSpy.first().at(2).value<quint32>());
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());
......
......@@ -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<quint32>());
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<quint32>());
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<quint32>());
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));