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
This commit is contained in:
Vlad Zahorodnii 2020-02-05 11:28:50 +02:00
parent dd96e444dd
commit 15af09c70a
23 changed files with 196 additions and 185 deletions

View file

@ -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());
}

View file

@ -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)

View file

@ -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));

View file

@ -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());

View file

@ -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());

View file

@ -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));
}

View file

@ -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));
}

View file

@ -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);
}

View file

@ -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));

View file

@ -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());

View file

@ -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));
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(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<quint32>());
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<quint32>());
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<quint32>());
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);

View file

@ -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<quint32>());
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<quint32>());
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<quint32>());
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<quint32>());
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<quint32>());
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<quint32>());
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<quint32>());
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<quint32>());
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));

View file

@ -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;

View file

@ -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();

View file

@ -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();

View file

@ -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()) {

View file

@ -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()
{

View file

@ -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

View file

@ -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.

View file

@ -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;

View file

@ -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()));
}

View file

@ -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()

View file

@ -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] {