Test fullscreen in conjuction with sendToScreen
This commit is contained in:
parent
44713ac642
commit
154a38adf5
1 changed files with 31 additions and 0 deletions
|
@ -52,6 +52,7 @@ private Q_SLOTS:
|
||||||
void testPlaceUnderMouse();
|
void testPlaceUnderMouse();
|
||||||
void testPlaceCascaded();
|
void testPlaceCascaded();
|
||||||
void testPlaceRandom();
|
void testPlaceRandom();
|
||||||
|
void testFullscreen();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setPlacementPolicy(Placement::Policy policy);
|
void setPlacementPolicy(Placement::Policy policy);
|
||||||
|
@ -345,5 +346,35 @@ void TestPlacement::testPlaceRandom()
|
||||||
QVERIFY(Test::waitForWindowDestroyed(client1));
|
QVERIFY(Test::waitForWindowDestroyed(client1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestPlacement::testFullscreen()
|
||||||
|
{
|
||||||
|
setPlacementPolicy(Placement::Smart);
|
||||||
|
QScopedPointer<Surface> surface(Test::createSurface());
|
||||||
|
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
|
||||||
|
AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red);
|
||||||
|
|
||||||
|
// auto-ack. XdgShell isn't being tested here, only the actual placement
|
||||||
|
connect(shellSurface.data(), &XdgShellSurface::configureRequested, [&](const QSize &size, KWayland::Client::XdgShellSurface::States, quint32 serial) {
|
||||||
|
if (!size.isEmpty()) {
|
||||||
|
shellSurface->ackConfigure(serial);
|
||||||
|
Test::render(surface.data(), size, Qt::red);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
QVERIFY(client);
|
||||||
|
client->sendToScreen(0);
|
||||||
|
|
||||||
|
QSignalSpy geometryChangedSpy(client, &Toplevel::frameGeometryChanged);
|
||||||
|
client->setFullScreen(true);
|
||||||
|
|
||||||
|
QVERIFY(geometryChangedSpy.wait());
|
||||||
|
QCOMPARE(client->frameGeometry(), screens()->geometry(0));
|
||||||
|
|
||||||
|
// this doesn't require a round trip, so should be immediate
|
||||||
|
client->sendToScreen(1);
|
||||||
|
QCOMPARE(client->frameGeometry(), screens()->geometry(1));
|
||||||
|
QCOMPARE(geometryChangedSpy.count(), 2);
|
||||||
|
}
|
||||||
|
|
||||||
WAYLANDTEST_MAIN(TestPlacement)
|
WAYLANDTEST_MAIN(TestPlacement)
|
||||||
#include "placement_test.moc"
|
#include "placement_test.moc"
|
||||||
|
|
Loading…
Reference in a new issue