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 "shell_client.h" | 28 | #include "xdgshellclient.h" | ||
29 | #include <kwineffects.h> | 29 | #include <kwineffects.h> | ||
30 | 30 | | |||
31 | #include <KWayland/Client/connection_thread.h> | 31 | #include <KWayland/Client/connection_thread.h> | ||
32 | #include <KWayland/Client/compositor.h> | 32 | #include <KWayland/Client/compositor.h> | ||
33 | #include <KWayland/Client/event_queue.h> | 33 | #include <KWayland/Client/event_queue.h> | ||
34 | #include <KWayland/Client/keyboard.h> | 34 | #include <KWayland/Client/keyboard.h> | ||
35 | #include <KWayland/Client/registry.h> | 35 | #include <KWayland/Client/registry.h> | ||
36 | #include <KWayland/Client/plasmashell.h> | 36 | #include <KWayland/Client/plasmashell.h> | ||
Show All 21 Lines | 55 | private Q_SLOTS: | |||
58 | void cleanup(); | 58 | void cleanup(); | ||
59 | void testXdgPopup_data(); | 59 | void testXdgPopup_data(); | ||
60 | void testXdgPopup(); | 60 | void testXdgPopup(); | ||
61 | void testXdgPopupWithPanel(); | 61 | void testXdgPopupWithPanel(); | ||
62 | }; | 62 | }; | ||
63 | 63 | | |||
64 | void TransientPlacementTest::initTestCase() | 64 | void TransientPlacementTest::initTestCase() | ||
65 | { | 65 | { | ||
66 | qRegisterMetaType<KWin::ShellClient*>(); | 66 | qRegisterMetaType<KWin::XdgShellClient *>(); | ||
67 | qRegisterMetaType<KWin::AbstractClient*>(); | 67 | qRegisterMetaType<KWin::AbstractClient*>(); | ||
68 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 68 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
69 | QVERIFY(workspaceCreatedSpy.isValid()); | 69 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
70 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 70 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
71 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 71 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
72 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | 72 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | ||
73 | 73 | | |||
74 | kwinApp()->start(); | 74 | kwinApp()->start(); | ||
▲ Show 20 Lines • Show All 239 Lines • ▼ Show 20 Line(s) | 263 | { | |||
314 | QVERIFY(Test::waitForWindowDestroyed(transient)); | 314 | QVERIFY(Test::waitForWindowDestroyed(transient)); | ||
315 | 315 | | |||
316 | // now parent to fullscreen - on fullscreen the panel is ignored | 316 | // now parent to fullscreen - on fullscreen the panel is ignored | ||
317 | QSignalSpy fullscreenSpy{parentShellSurface, &XdgShellSurface::configureRequested}; | 317 | QSignalSpy fullscreenSpy{parentShellSurface, &XdgShellSurface::configureRequested}; | ||
318 | QVERIFY(fullscreenSpy.isValid()); | 318 | QVERIFY(fullscreenSpy.isValid()); | ||
319 | parent->setFullScreen(true); | 319 | parent->setFullScreen(true); | ||
320 | QVERIFY(fullscreenSpy.wait()); | 320 | QVERIFY(fullscreenSpy.wait()); | ||
321 | parentShellSurface->ackConfigure(fullscreenSpy.first().at(2).value<quint32>()); | 321 | parentShellSurface->ackConfigure(fullscreenSpy.first().at(2).value<quint32>()); | ||
322 | QSignalSpy geometryShapeChangedSpy{parent, &ShellClient::geometryShapeChanged}; | 322 | QSignalSpy geometryShapeChangedSpy{parent, &XdgShellClient::geometryShapeChanged}; | ||
323 | QVERIFY(geometryShapeChangedSpy.isValid()); | 323 | QVERIFY(geometryShapeChangedSpy.isValid()); | ||
324 | Test::render(parentSurface, fullscreenSpy.first().at(0).toSize(), Qt::red); | 324 | Test::render(parentSurface, fullscreenSpy.first().at(0).toSize(), Qt::red); | ||
325 | QVERIFY(geometryShapeChangedSpy.wait()); | 325 | QVERIFY(geometryShapeChangedSpy.wait()); | ||
326 | QCOMPARE(parent->geometry(), screens()->geometry(0)); | 326 | QCOMPARE(parent->geometry(), screens()->geometry(0)); | ||
327 | QVERIFY(parent->isFullScreen()); | 327 | QVERIFY(parent->isFullScreen()); | ||
328 | 328 | | |||
329 | // another transient, with same hints as before from bottom of window | 329 | // another transient, with same hints as before from bottom of window | ||
330 | transientSurface = Test::createSurface(Test::waylandCompositor()); | 330 | transientSurface = Test::createSurface(Test::waylandCompositor()); | ||
Show All 17 Lines |