xdgshellwindow_test.cpp | xdgshellwindow_test.cpp | |||
---|---|---|---|---|
skipping to change at line 378 | skipping to change at line 378 | |||
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::Xdg Toplevel::configureRequested); | QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::Xdg Toplevel::configureRequested); | |||
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Te st::XdgSurface::configureRequested); | QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Te st::XdgSurface::configureRequested); | |||
// Initialize the xdg-toplevel surface. | // Initialize the xdg-toplevel surface. | |||
QFETCH(Test::XdgToplevelDecorationV1::mode, decoMode); | QFETCH(Test::XdgToplevelDecorationV1::mode, decoMode); | |||
decoration->set_mode(decoMode); | decoration->set_mode(decoMode); | |||
surface->commit(KWayland::Client::Surface::CommitFlag::None); | surface->commit(KWayland::Client::Surface::CommitFlag::None); | |||
QVERIFY(surfaceConfigureRequestedSpy.wait()); | QVERIFY(surfaceConfigureRequestedSpy.wait()); | |||
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy. last().at(0).value<quint32>()); | shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy. last().at(0).value<quint32>()); | |||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50) , Qt::blue); | auto window = Test::renderAndWaitForShown(surface.get(), QSize(500, 250 ), Qt::blue); | |||
QVERIFY(window); | QVERIFY(window); | |||
QVERIFY(window->isActive()); | QVERIFY(window->isActive()); | |||
QCOMPARE(window->layer(), NormalLayer); | QCOMPARE(window->layer(), NormalLayer); | |||
QVERIFY(!window->isFullScreen()); | QVERIFY(!window->isFullScreen()); | |||
QCOMPARE(window->clientSize(), QSize(100, 50)); | QCOMPARE(window->clientSize(), QSize(500, 250)); | |||
QCOMPARE(window->isDecorated(), decoMode == Test::XdgToplevelDecoration V1::mode_server_side); | QCOMPARE(window->isDecorated(), decoMode == Test::XdgToplevelDecoration V1::mode_server_side); | |||
QCOMPARE(window->clientSizeToFrameSize(window->clientSize()), window->s ize()); | QCOMPARE(window->clientSizeToFrameSize(window->clientSize()), window->s ize()); | |||
QSignalSpy fullScreenChangedSpy(window, &Window::fullScreenChanged); | QSignalSpy fullScreenChangedSpy(window, &Window::fullScreenChanged); | |||
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChange d); | QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChange d); | |||
// Wait for the compositor to send a configure event with the Activated state. | // Wait for the compositor to send a configure event with the Activated state. | |||
QVERIFY(surfaceConfigureRequestedSpy.wait()); | QVERIFY(surfaceConfigureRequestedSpy.wait()); | |||
QCOMPARE(surfaceConfigureRequestedSpy.count(), 2); | QCOMPARE(surfaceConfigureRequestedSpy.count(), 2); | |||
states = toplevelConfigureRequestedSpy.last().at(1).value<Test::XdgTopl evel::States>(); | states = toplevelConfigureRequestedSpy.last().at(1).value<Test::XdgTopl evel::States>(); | |||
skipping to change at line 420 | skipping to change at line 420 | |||
QVERIFY(!window->isDecorated()); | QVERIFY(!window->isDecorated()); | |||
QCOMPARE(window->layer(), ActiveLayer); | QCOMPARE(window->layer(), ActiveLayer); | |||
QCOMPARE(window->frameGeometry(), QRect(QPoint(0, 0), window->output()- >geometry().size())); | QCOMPARE(window->frameGeometry(), QRect(QPoint(0, 0), window->output()- >geometry().size())); | |||
// Ask the compositor to show the window in normal mode. | // Ask the compositor to show the window in normal mode. | |||
shellSurface->unset_fullscreen(); | shellSurface->unset_fullscreen(); | |||
QVERIFY(surfaceConfigureRequestedSpy.wait()); | QVERIFY(surfaceConfigureRequestedSpy.wait()); | |||
QCOMPARE(surfaceConfigureRequestedSpy.count(), 4); | QCOMPARE(surfaceConfigureRequestedSpy.count(), 4); | |||
states = toplevelConfigureRequestedSpy.last().at(1).value<Test::XdgTopl evel::States>(); | states = toplevelConfigureRequestedSpy.last().at(1).value<Test::XdgTopl evel::States>(); | |||
QVERIFY(!(states & Test::XdgToplevel::State::Fullscreen)); | QVERIFY(!(states & Test::XdgToplevel::State::Fullscreen)); | |||
QCOMPARE(toplevelConfigureRequestedSpy.last().at(0).value<QSize>(), QSi ze(100, 50)); | QCOMPARE(toplevelConfigureRequestedSpy.last().at(0).value<QSize>(), QSi ze(500, 250)); | |||
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy. last().at(0).value<quint32>()); | shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy. last().at(0).value<quint32>()); | |||
Test::render(surface.get(), toplevelConfigureRequestedSpy.last().at(0). value<QSize>(), Qt::blue); | Test::render(surface.get(), toplevelConfigureRequestedSpy.last().at(0). value<QSize>(), Qt::blue); | |||
QVERIFY(fullScreenChangedSpy.wait()); | QVERIFY(fullScreenChangedSpy.wait()); | |||
QCOMPARE(fullScreenChangedSpy.count(), 2); | QCOMPARE(fullScreenChangedSpy.count(), 2); | |||
QCOMPARE(window->clientSize(), QSize(100, 50)); | QCOMPARE(window->clientSize(), QSize(500, 250)); | |||
QVERIFY(!window->isFullScreen()); | QVERIFY(!window->isFullScreen()); | |||
QCOMPARE(window->isDecorated(), decoMode == Test::XdgToplevelDecoration V1::mode_server_side); | QCOMPARE(window->isDecorated(), decoMode == Test::XdgToplevelDecoration V1::mode_server_side); | |||
QCOMPARE(window->layer(), NormalLayer); | QCOMPARE(window->layer(), NormalLayer); | |||
// Destroy the window. | // Destroy the window. | |||
shellSurface.reset(); | shellSurface.reset(); | |||
QVERIFY(Test::waitForWindowDestroyed(window)); | QVERIFY(Test::waitForWindowDestroyed(window)); | |||
} | } | |||
void TestXdgShellWindow::testUserCanSetFullscreen() | void TestXdgShellWindow::testUserCanSetFullscreen() | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |