Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/transient_placement.cpp
Show All 19 Lines | |||||
20 | #include "kwin_wayland_test.h" | 20 | #include "kwin_wayland_test.h" | ||
21 | #include "platform.h" | 21 | #include "platform.h" | ||
22 | #include "abstract_client.h" | 22 | #include "abstract_client.h" | ||
23 | #include "cursor.h" | 23 | #include "cursor.h" | ||
24 | #include "screenedge.h" | 24 | #include "screenedge.h" | ||
25 | #include "screens.h" | 25 | #include "screens.h" | ||
26 | #include "wayland_server.h" | 26 | #include "wayland_server.h" | ||
27 | #include "workspace.h" | 27 | #include "workspace.h" | ||
28 | #include "xdgshellclient.h" | | |||
29 | #include <kwineffects.h> | 28 | #include <kwineffects.h> | ||
30 | 29 | | |||
31 | #include <KWayland/Client/connection_thread.h> | 30 | #include <KWayland/Client/connection_thread.h> | ||
32 | #include <KWayland/Client/compositor.h> | 31 | #include <KWayland/Client/compositor.h> | ||
33 | #include <KWayland/Client/event_queue.h> | 32 | #include <KWayland/Client/event_queue.h> | ||
34 | #include <KWayland/Client/keyboard.h> | 33 | #include <KWayland/Client/keyboard.h> | ||
35 | #include <KWayland/Client/registry.h> | 34 | #include <KWayland/Client/registry.h> | ||
36 | #include <KWayland/Client/plasmashell.h> | 35 | #include <KWayland/Client/plasmashell.h> | ||
Show All 21 Lines | 54 | private Q_SLOTS: | |||
58 | void cleanup(); | 57 | void cleanup(); | ||
59 | void testXdgPopup_data(); | 58 | void testXdgPopup_data(); | ||
60 | void testXdgPopup(); | 59 | void testXdgPopup(); | ||
61 | void testXdgPopupWithPanel(); | 60 | void testXdgPopupWithPanel(); | ||
62 | }; | 61 | }; | ||
63 | 62 | | |||
64 | void TransientPlacementTest::initTestCase() | 63 | void TransientPlacementTest::initTestCase() | ||
65 | { | 64 | { | ||
66 | qRegisterMetaType<KWin::XdgShellClient *>(); | | |||
67 | qRegisterMetaType<KWin::AbstractClient*>(); | 65 | qRegisterMetaType<KWin::AbstractClient*>(); | ||
68 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 66 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
69 | QVERIFY(workspaceCreatedSpy.isValid()); | 67 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
70 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 68 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
71 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 69 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
72 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | 70 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | ||
73 | 71 | | |||
74 | kwinApp()->start(); | 72 | kwinApp()->start(); | ||
▲ Show 20 Lines • Show All 260 Lines • ▼ Show 20 Line(s) | 282 | { | |||
335 | QVERIFY(Test::waitForWindowDestroyed(transient)); | 333 | QVERIFY(Test::waitForWindowDestroyed(transient)); | ||
336 | 334 | | |||
337 | // now parent to fullscreen - on fullscreen the panel is ignored | 335 | // now parent to fullscreen - on fullscreen the panel is ignored | ||
338 | QSignalSpy fullscreenSpy{parentShellSurface, &XdgShellSurface::configureRequested}; | 336 | QSignalSpy fullscreenSpy{parentShellSurface, &XdgShellSurface::configureRequested}; | ||
339 | QVERIFY(fullscreenSpy.isValid()); | 337 | QVERIFY(fullscreenSpy.isValid()); | ||
340 | parent->setFullScreen(true); | 338 | parent->setFullScreen(true); | ||
341 | QVERIFY(fullscreenSpy.wait()); | 339 | QVERIFY(fullscreenSpy.wait()); | ||
342 | parentShellSurface->ackConfigure(fullscreenSpy.first().at(2).value<quint32>()); | 340 | parentShellSurface->ackConfigure(fullscreenSpy.first().at(2).value<quint32>()); | ||
343 | QSignalSpy frameGeometryChangedSpy{parent, &XdgShellClient::frameGeometryChanged}; | 341 | QSignalSpy frameGeometryChangedSpy{parent, &AbstractClient::frameGeometryChanged}; | ||
344 | QVERIFY(frameGeometryChangedSpy.isValid()); | 342 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
345 | Test::render(parentSurface, fullscreenSpy.first().at(0).toSize(), Qt::red); | 343 | Test::render(parentSurface, fullscreenSpy.first().at(0).toSize(), Qt::red); | ||
346 | QVERIFY(frameGeometryChangedSpy.wait()); | 344 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
347 | QCOMPARE(parent->frameGeometry(), screens()->geometry(0)); | 345 | QCOMPARE(parent->frameGeometry(), screens()->geometry(0)); | ||
348 | QVERIFY(parent->isFullScreen()); | 346 | QVERIFY(parent->isFullScreen()); | ||
349 | 347 | | |||
350 | // another transient, with same hints as before from bottom of window | 348 | // another transient, with same hints as before from bottom of window | ||
351 | transientSurface = Test::createSurface(Test::waylandCompositor()); | 349 | transientSurface = Test::createSurface(Test::waylandCompositor()); | ||
Show All 17 Lines |