diff --git a/abstract_client.h b/abstract_client.h --- a/abstract_client.h +++ b/abstract_client.h @@ -440,6 +440,7 @@ */ virtual bool hasTransient(const AbstractClient* c, bool indirect) const; const QList& transients() const; // Is not indirect + virtual void addTransient(AbstractClient *client); virtual void removeTransient(AbstractClient* cl); virtual QList mainClients() const; // Call once before loop , is not indirect QList allMainClients() const; // Call once before loop , is indirect @@ -613,6 +614,8 @@ Layer layer() const override; void updateLayer(); + void placeIn(const QRect &area); + enum ForceGeometry_t { NormalGeometrySet, ForceGeometrySet }; virtual void move(int x, int y, ForceGeometry_t force = NormalGeometrySet); void move(const QPoint &p, ForceGeometry_t force = NormalGeometrySet); @@ -970,7 +973,6 @@ virtual void updateColorScheme() = 0; void setTransientFor(AbstractClient *transientFor); - virtual void addTransient(AbstractClient* cl); /** * Just removes the @p cl from the transients without any further checks. */ diff --git a/abstract_client.cpp b/abstract_client.cpp --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -252,6 +252,14 @@ (*it)->updateLayer(); } +void AbstractClient::placeIn(const QRect &area) +{ + // TODO: Get rid of this method eventually. We need to call setGeometryRestore() because + // checkWorkspacePosition() operates on geometryRestore() and because of quick tiling. + Placement::self()->place(this, area); + setGeometryRestore(frameGeometry()); +} + void AbstractClient::invalidateLayer() { m_layer = UnknownLayer; @@ -2332,7 +2340,7 @@ QRect candidateGeom; for (auto i = windowManagementInterface()->minimizedGeometries().constBegin(), end = windowManagementInterface()->minimizedGeometries().constEnd(); i != end; ++i) { - AbstractClient *client = waylandServer()->findAbstractClient(i.key()); + AbstractClient *client = waylandServer()->findClient(i.key()); if (!client) { continue; } diff --git a/autotests/integration/activation_test.cpp b/autotests/integration/activation_test.cpp --- a/autotests/integration/activation_test.cpp +++ b/autotests/integration/activation_test.cpp @@ -20,12 +20,12 @@ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "cursor.h" #include "platform.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include @@ -58,7 +58,6 @@ void ActivationTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); @@ -101,13 +100,13 @@ // Create several clients on the left screen. QScopedPointer surface1(Test::createSurface()); QScopedPointer shellSurface1(Test::createXdgShellStableSurface(surface1.data())); - XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); + AbstractClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); QVERIFY(client1); QVERIFY(client1->isActive()); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); - XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); + AbstractClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); QVERIFY(client2); QVERIFY(client2->isActive()); @@ -117,13 +116,13 @@ // Create several clients on the right screen. QScopedPointer surface3(Test::createSurface()); QScopedPointer shellSurface3(Test::createXdgShellStableSurface(surface3.data())); - XdgShellClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); + AbstractClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); QVERIFY(client3); QVERIFY(client3->isActive()); QScopedPointer surface4(Test::createSurface()); QScopedPointer shellSurface4(Test::createXdgShellStableSurface(surface4.data())); - XdgShellClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); + AbstractClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); QVERIFY(client4); QVERIFY(client4->isActive()); @@ -169,13 +168,13 @@ // Create several clients on the left screen. QScopedPointer surface1(Test::createSurface()); QScopedPointer shellSurface1(Test::createXdgShellStableSurface(surface1.data())); - XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); + AbstractClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); QVERIFY(client1); QVERIFY(client1->isActive()); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); - XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); + AbstractClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); QVERIFY(client2); QVERIFY(client2->isActive()); @@ -185,13 +184,13 @@ // Create several clients on the right screen. QScopedPointer surface3(Test::createSurface()); QScopedPointer shellSurface3(Test::createXdgShellStableSurface(surface3.data())); - XdgShellClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); + AbstractClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); QVERIFY(client3); QVERIFY(client3->isActive()); QScopedPointer surface4(Test::createSurface()); QScopedPointer shellSurface4(Test::createXdgShellStableSurface(surface4.data())); - XdgShellClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); + AbstractClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); QVERIFY(client4); QVERIFY(client4->isActive()); @@ -237,13 +236,13 @@ // Create several clients on the top screen. QScopedPointer surface1(Test::createSurface()); QScopedPointer shellSurface1(Test::createXdgShellStableSurface(surface1.data())); - XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); + AbstractClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); QVERIFY(client1); QVERIFY(client1->isActive()); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); - XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); + AbstractClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); QVERIFY(client2); QVERIFY(client2->isActive()); @@ -253,13 +252,13 @@ // Create several clients on the bottom screen. QScopedPointer surface3(Test::createSurface()); QScopedPointer shellSurface3(Test::createXdgShellStableSurface(surface3.data())); - XdgShellClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); + AbstractClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); QVERIFY(client3); QVERIFY(client3->isActive()); QScopedPointer surface4(Test::createSurface()); QScopedPointer shellSurface4(Test::createXdgShellStableSurface(surface4.data())); - XdgShellClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); + AbstractClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); QVERIFY(client4); QVERIFY(client4->isActive()); @@ -305,13 +304,13 @@ // Create several clients on the top screen. QScopedPointer surface1(Test::createSurface()); QScopedPointer shellSurface1(Test::createXdgShellStableSurface(surface1.data())); - XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); + AbstractClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); QVERIFY(client1); QVERIFY(client1->isActive()); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); - XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); + AbstractClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); QVERIFY(client2); QVERIFY(client2->isActive()); @@ -321,13 +320,13 @@ // Create several clients on the bottom screen. QScopedPointer surface3(Test::createSurface()); QScopedPointer shellSurface3(Test::createXdgShellStableSurface(surface3.data())); - XdgShellClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); + AbstractClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); QVERIFY(client3); QVERIFY(client3->isActive()); QScopedPointer surface4(Test::createSurface()); QScopedPointer shellSurface4(Test::createXdgShellStableSurface(surface4.data())); - XdgShellClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); + AbstractClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); QVERIFY(client4); QVERIFY(client4->isActive()); @@ -374,29 +373,29 @@ // Create several maximized clients on the left screen. QScopedPointer surface1(Test::createSurface()); QScopedPointer shellSurface1(Test::createXdgShellStableSurface(surface1.data())); - XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); + AbstractClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); QVERIFY(client1); QVERIFY(client1->isActive()); QSignalSpy configureRequestedSpy1(shellSurface1.data(), &XdgShellSurface::configureRequested); QVERIFY(configureRequestedSpy1.wait()); workspace()->slotWindowMaximize(); QVERIFY(configureRequestedSpy1.wait()); - QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy1(client1, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy1.isValid()); shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value()); Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red); QVERIFY(frameGeometryChangedSpy1.wait()); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); - XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); + AbstractClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); QVERIFY(client2); QVERIFY(client2->isActive()); QSignalSpy configureRequestedSpy2(shellSurface2.data(), &XdgShellSurface::configureRequested); QVERIFY(configureRequestedSpy2.wait()); workspace()->slotWindowMaximize(); QVERIFY(configureRequestedSpy2.wait()); - QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy2(client2, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy2.isValid()); shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value()); Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red); @@ -410,13 +409,13 @@ // Create several clients on the right screen. QScopedPointer surface3(Test::createSurface()); QScopedPointer shellSurface3(Test::createXdgShellStableSurface(surface3.data())); - XdgShellClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); + AbstractClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); QVERIFY(client3); QVERIFY(client3->isActive()); QScopedPointer surface4(Test::createSurface()); QScopedPointer shellSurface4(Test::createXdgShellStableSurface(surface4.data())); - XdgShellClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); + AbstractClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); QVERIFY(client4); QVERIFY(client4->isActive()); @@ -459,29 +458,29 @@ // Create several maximized clients on the top screen. QScopedPointer surface1(Test::createSurface()); QScopedPointer shellSurface1(Test::createXdgShellStableSurface(surface1.data())); - XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); + AbstractClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); QVERIFY(client1); QVERIFY(client1->isActive()); QSignalSpy configureRequestedSpy1(shellSurface1.data(), &XdgShellSurface::configureRequested); QVERIFY(configureRequestedSpy1.wait()); workspace()->slotWindowFullScreen(); QVERIFY(configureRequestedSpy1.wait()); - QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy1(client1, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy1.isValid()); shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value()); Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red); QVERIFY(frameGeometryChangedSpy1.wait()); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); - XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); + AbstractClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); QVERIFY(client2); QVERIFY(client2->isActive()); QSignalSpy configureRequestedSpy2(shellSurface2.data(), &XdgShellSurface::configureRequested); QVERIFY(configureRequestedSpy2.wait()); workspace()->slotWindowFullScreen(); QVERIFY(configureRequestedSpy2.wait()); - QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy2(client2, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy2.isValid()); shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value()); Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red); @@ -495,13 +494,13 @@ // Create several clients on the bottom screen. QScopedPointer surface3(Test::createSurface()); QScopedPointer shellSurface3(Test::createXdgShellStableSurface(surface3.data())); - XdgShellClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); + AbstractClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue); QVERIFY(client3); QVERIFY(client3->isActive()); QScopedPointer surface4(Test::createSurface()); QScopedPointer shellSurface4(Test::createXdgShellStableSurface(surface4.data())); - XdgShellClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); + AbstractClient *client4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue); QVERIFY(client4); QVERIFY(client4->isActive()); diff --git a/autotests/integration/activities_test.cpp b/autotests/integration/activities_test.cpp --- a/autotests/integration/activities_test.cpp +++ b/autotests/integration/activities_test.cpp @@ -27,7 +27,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include "xcbutils.h" #include @@ -58,7 +57,6 @@ void ActivitiesTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/buffer_size_change_test.cpp b/autotests/integration/buffer_size_change_test.cpp --- a/autotests/integration/buffer_size_change_test.cpp +++ b/autotests/integration/buffer_size_change_test.cpp @@ -19,8 +19,8 @@ *********************************************************************/ #include "generic_scene_opengl_test.h" +#include "abstract_client.h" #include "composite.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include @@ -61,7 +61,7 @@ QVERIFY(!shellSurface.isNull()); // set buffer size - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); // add a first repaint @@ -73,7 +73,7 @@ // now change buffer size Test::render(surface.data(), QSize(30, 10), Qt::red); - QSignalSpy damagedSpy(client, &XdgShellClient::damaged); + QSignalSpy damagedSpy(client, &AbstractClient::damaged); QVERIFY(damagedSpy.isValid()); QVERIFY(damagedSpy.wait()); KWin::Compositor::self()->addRepaintFull(); @@ -98,7 +98,7 @@ // set buffer sizes Test::render(surface.data(), QSize(30, 10), Qt::red); - XdgShellClient *parent = Test::renderAndWaitForShown(parentSurface.data(), QSize(100, 50), Qt::blue); + AbstractClient *parent = Test::renderAndWaitForShown(parentSurface.data(), QSize(100, 50), Qt::blue); QVERIFY(parent); // add a first repaint @@ -108,7 +108,7 @@ QVERIFY(swapSpy.wait()); // change buffer size of sub surface - QSignalSpy damagedParentSpy(parent, &XdgShellClient::damaged); + QSignalSpy damagedParentSpy(parent, &AbstractClient::damaged); QVERIFY(damagedParentSpy.isValid()); Test::render(surface.data(), QSize(20, 10), Qt::red); parentSurface->commit(Surface::CommitFlag::None); diff --git a/autotests/integration/dbus_interface_test.cpp b/autotests/integration/dbus_interface_test.cpp --- a/autotests/integration/dbus_interface_test.cpp +++ b/autotests/integration/dbus_interface_test.cpp @@ -21,13 +21,13 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "atoms.h" #include "x11client.h" #include "deleted.h" #include "platform.h" #include "rules.h" #include "screens.h" -#include "xdgshellclient.h" #include "virtualdesktops.h" #include "wayland_server.h" #include "workspace.h" @@ -69,7 +69,6 @@ void TestDbusInterface::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -135,7 +134,7 @@ Test::render(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(clientAddedSpy.isEmpty()); QVERIFY(clientAddedSpy.wait()); - auto client = clientAddedSpy.first().first().value(); + auto client = clientAddedSpy.first().first().value(); QVERIFY(client); // let's get the window info @@ -226,7 +225,7 @@ // finally close window const auto id = client->internalId(); - QSignalSpy windowClosedSpy(client, &XdgShellClient::windowClosed); + QSignalSpy windowClosedSpy(client, &AbstractClient::windowClosed); QVERIFY(windowClosedSpy.isValid()); shellSurface.reset(); surface.reset(); diff --git a/autotests/integration/debug_console_test.cpp b/autotests/integration/debug_console_test.cpp --- a/autotests/integration/debug_console_test.cpp +++ b/autotests/integration/debug_console_test.cpp @@ -18,11 +18,11 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "debug_console.h" #include "internal_client.h" #include "platform.h" #include "screens.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" #include "xcbutils.h" @@ -60,7 +60,6 @@ { qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); diff --git a/autotests/integration/decoration_input_test.cpp b/autotests/integration/decoration_input_test.cpp --- a/autotests/integration/decoration_input_test.cpp +++ b/autotests/integration/decoration_input_test.cpp @@ -26,7 +26,6 @@ #include "touch_input.h" #include "screenedge.h" #include "screens.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" #include @@ -135,7 +134,6 @@ { qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); diff --git a/autotests/integration/desktop_window_x11_test.cpp b/autotests/integration/desktop_window_x11_test.cpp --- a/autotests/integration/desktop_window_x11_test.cpp +++ b/autotests/integration/desktop_window_x11_test.cpp @@ -18,15 +18,15 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "platform.h" #include "x11client.h" #include "cursor.h" #include "deleted.h" #include "screenedge.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include "xcbutils.h" #include @@ -52,7 +52,6 @@ void X11DesktopWindowTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp --- a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp +++ b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp @@ -27,7 +27,6 @@ #include "wayland_server.h" #include "workspace.h" #include "scene.h" -#include "xdgshellclient.h" #include #include @@ -54,7 +53,6 @@ void DontCrashAuroraeDestroyDecoTest::initTestCase() { qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/dont_crash_cancel_animation.cpp b/autotests/integration/dont_crash_cancel_animation.cpp --- a/autotests/integration/dont_crash_cancel_animation.cpp +++ b/autotests/integration/dont_crash_cancel_animation.cpp @@ -26,7 +26,6 @@ #include "effects.h" #include "effectloader.h" #include "screens.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" #include "scripting/scriptedeffect.h" @@ -56,7 +55,6 @@ void DontCrashCancelAnimationFromAnimationEndedTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType(); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); diff --git a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp --- a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp +++ b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp @@ -24,7 +24,6 @@ #include "cursor.h" #include "effects.h" #include "platform.h" -#include "xdgshellclient.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" @@ -67,7 +66,6 @@ void DontCrashCursorPhysicalSizeEmpty::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/dont_crash_empty_deco.cpp b/autotests/integration/dont_crash_empty_deco.cpp --- a/autotests/integration/dont_crash_empty_deco.cpp +++ b/autotests/integration/dont_crash_empty_deco.cpp @@ -27,7 +27,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -50,7 +49,6 @@ void DontCrashEmptyDecorationTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/dont_crash_no_border.cpp b/autotests/integration/dont_crash_no_border.cpp --- a/autotests/integration/dont_crash_no_border.cpp +++ b/autotests/integration/dont_crash_no_border.cpp @@ -28,7 +28,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -56,7 +55,6 @@ void DontCrashNoBorder::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/dont_crash_reinitialize_compositor.cpp b/autotests/integration/dont_crash_reinitialize_compositor.cpp --- a/autotests/integration/dont_crash_reinitialize_compositor.cpp +++ b/autotests/integration/dont_crash_reinitialize_compositor.cpp @@ -27,7 +27,6 @@ #include "effects.h" #include "platform.h" #include "screens.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -60,7 +59,6 @@ qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); @@ -134,7 +132,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); // Make sure that only the test effect is loaded. @@ -147,7 +145,7 @@ QVERIFY(!effect->isActive()); // Close the test client. - QSignalSpy windowClosedSpy(client, &XdgShellClient::windowClosed); + QSignalSpy windowClosedSpy(client, &AbstractClient::windowClosed); QVERIFY(windowClosedSpy.isValid()); shellSurface.reset(); surface.reset(); diff --git a/autotests/integration/dont_crash_useractions_menu.cpp b/autotests/integration/dont_crash_useractions_menu.cpp --- a/autotests/integration/dont_crash_useractions_menu.cpp +++ b/autotests/integration/dont_crash_useractions_menu.cpp @@ -18,11 +18,11 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "cursor.h" #include "keyboard_input.h" #include "platform.h" #include "pointer_input.h" -#include "xdgshellclient.h" #include "screens.h" #include "useractions.h" #include "wayland_server.h" @@ -56,7 +56,6 @@ void TestDontCrashUseractionsMenu::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/effects/desktop_switching_animation_test.cpp b/autotests/integration/effects/desktop_switching_animation_test.cpp --- a/autotests/integration/effects/desktop_switching_animation_test.cpp +++ b/autotests/integration/effects/desktop_switching_animation_test.cpp @@ -26,7 +26,6 @@ #include "effects.h" #include "platform.h" #include "scene.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -57,7 +56,6 @@ qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); @@ -128,7 +126,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QCOMPARE(client->desktops().count(), 1); QCOMPARE(client->desktops().first(), VirtualDesktopManager::self()->desktops().first()); diff --git a/autotests/integration/effects/fade_test.cpp b/autotests/integration/effects/fade_test.cpp --- a/autotests/integration/effects/fade_test.cpp +++ b/autotests/integration/effects/fade_test.cpp @@ -18,12 +18,12 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "composite.h" #include "effects.h" #include "effectloader.h" #include "cursor.h" #include "platform.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" #include "effect_builtins.h" @@ -55,7 +55,6 @@ void FadeTest::initTestCase() { qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/effects/maximize_animation_test.cpp b/autotests/integration/effects/maximize_animation_test.cpp --- a/autotests/integration/effects/maximize_animation_test.cpp +++ b/autotests/integration/effects/maximize_animation_test.cpp @@ -26,7 +26,6 @@ #include "effects.h" #include "platform.h" #include "scene.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -57,7 +56,6 @@ qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); @@ -133,7 +131,7 @@ // Draw contents of the surface. shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); @@ -157,9 +155,9 @@ QVERIFY(!effect->isActive()); // Maximize the client. - QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); - QSignalSpy maximizeChangedSpy(client, qOverload(&XdgShellClient::clientMaximizedStateChanged)); + QSignalSpy maximizeChangedSpy(client, qOverload(&AbstractClient::clientMaximizedStateChanged)); QVERIFY(maximizeChangedSpy.isValid()); workspace()->slotWindowMaximize(); diff --git a/autotests/integration/effects/minimize_animation_test.cpp b/autotests/integration/effects/minimize_animation_test.cpp --- a/autotests/integration/effects/minimize_animation_test.cpp +++ b/autotests/integration/effects/minimize_animation_test.cpp @@ -26,7 +26,6 @@ #include "effects.h" #include "platform.h" #include "scene.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -59,7 +58,6 @@ qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); @@ -134,7 +132,7 @@ plasmaPanelShellSurface->setRole(PlasmaShellSurface::Role::Panel); plasmaPanelShellSurface->setPosition(panelRect.topLeft()); plasmaPanelShellSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AlwaysVisible); - XdgShellClient *panel = Test::renderAndWaitForShown(panelSurface.data(), panelRect.size(), Qt::blue); + AbstractClient *panel = Test::renderAndWaitForShown(panelSurface.data(), panelRect.size(), Qt::blue); QVERIFY(panel); QVERIFY(panel->isDock()); QCOMPARE(panel->frameGeometry(), panelRect); @@ -146,7 +144,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); QVERIFY(client); QVERIFY(plasmaWindowCreatedSpy.wait()); QCOMPARE(plasmaWindowCreatedSpy.count(), 2); diff --git a/autotests/integration/effects/popup_open_close_animation_test.cpp b/autotests/integration/effects/popup_open_close_animation_test.cpp --- a/autotests/integration/effects/popup_open_close_animation_test.cpp +++ b/autotests/integration/effects/popup_open_close_animation_test.cpp @@ -26,7 +26,6 @@ #include "effects.h" #include "internal_client.h" #include "platform.h" -#include "xdgshellclient.h" #include "useractions.h" #include "wayland_server.h" #include "workspace.h" @@ -66,7 +65,6 @@ qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); @@ -119,7 +117,7 @@ QVERIFY(!mainWindowSurface.isNull()); QScopedPointer mainWindowShellSurface(Test::createXdgShellStableSurface(mainWindowSurface.data())); QVERIFY(!mainWindowShellSurface.isNull()); - XdgShellClient *mainWindow = Test::renderAndWaitForShown(mainWindowSurface.data(), QSize(100, 50), Qt::blue); + AbstractClient *mainWindow = Test::renderAndWaitForShown(mainWindowSurface.data(), QSize(100, 50), Qt::blue); QVERIFY(mainWindow); // Load effect that will be tested. @@ -139,7 +137,7 @@ positioner.setAnchorEdge(Qt::BottomEdge | Qt::LeftEdge); QScopedPointer popupShellSurface(Test::createXdgShellStablePopup(popupSurface.data(), mainWindowShellSurface.data(), positioner)); QVERIFY(!popupShellSurface.isNull()); - XdgShellClient *popup = Test::renderAndWaitForShown(popupSurface.data(), positioner.initialSize(), Qt::red); + AbstractClient *popup = Test::renderAndWaitForShown(popupSurface.data(), positioner.initialSize(), Qt::red); QVERIFY(popup); QVERIFY(popup->isPopupWindow()); QCOMPARE(popup->transientFor(), mainWindow); @@ -149,7 +147,7 @@ QTRY_VERIFY(!effect->isActive()); // Destroy the popup, it should not be animated. - QSignalSpy popupClosedSpy(popup, &XdgShellClient::windowClosed); + QSignalSpy popupClosedSpy(popup, &AbstractClient::windowClosed); QVERIFY(popupClosedSpy.isValid()); popupShellSurface.reset(); popupSurface.reset(); @@ -179,7 +177,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); // Load effect that will be tested. @@ -234,7 +232,7 @@ QScopedPointer deco(Test::xdgDecorationManager()->getToplevelDecoration(shellSurface.data())); QVERIFY(!deco.isNull()); deco->setMode(XdgDecoration::Mode::ServerSide); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(client->isDecorated()); diff --git a/autotests/integration/effects/scripted_effects_test.cpp b/autotests/integration/effects/scripted_effects_test.cpp --- a/autotests/integration/effects/scripted_effects_test.cpp +++ b/autotests/integration/effects/scripted_effects_test.cpp @@ -21,15 +21,15 @@ #include "scripting/scriptedeffect.h" #include "libkwineffects/anidata_p.h" +#include "abstract_client.h" #include "composite.h" #include "cursor.h" #include "deleted.h" #include "effect_builtins.h" #include "effectloader.h" #include "effects.h" #include "kwin_wayland_test.h" #include "platform.h" -#include "xdgshellclient.h" #include "virtualdesktops.h" #include "wayland_server.h" #include "workspace.h" @@ -143,7 +143,6 @@ void ScriptedEffectsTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); @@ -511,7 +510,7 @@ QVERIFY(surface); XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); QVERIFY(shellSurface); - XdgShellClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); + AbstractClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); @@ -544,7 +543,7 @@ QVERIFY(surface); XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); QVERIFY(shellSurface); - XdgShellClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); + AbstractClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); @@ -581,7 +580,7 @@ QVERIFY(surface); XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); QVERIFY(shellSurface); - XdgShellClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); + AbstractClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); @@ -612,7 +611,7 @@ QVERIFY(surface); XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); QVERIFY(shellSurface); - XdgShellClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); + AbstractClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); @@ -655,7 +654,7 @@ QVERIFY(surface); XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); QVERIFY(shellSurface); - XdgShellClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); + AbstractClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); @@ -733,7 +732,7 @@ QVERIFY(surface); XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); QVERIFY(shellSurface); - XdgShellClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); + AbstractClient *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); QVERIFY(c); QCOMPARE(workspace()->activeClient(), c); diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -26,7 +26,6 @@ #include "cursor.h" #include "platform.h" #include "scene.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" #include "effect_builtins.h" @@ -61,7 +60,6 @@ void SlidingPopupsTest::initTestCase() { qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); diff --git a/autotests/integration/effects/toplevel_open_close_animation_test.cpp b/autotests/integration/effects/toplevel_open_close_animation_test.cpp --- a/autotests/integration/effects/toplevel_open_close_animation_test.cpp +++ b/autotests/integration/effects/toplevel_open_close_animation_test.cpp @@ -27,7 +27,6 @@ #include "effects.h" #include "platform.h" #include "scene.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -61,7 +60,6 @@ qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); @@ -137,16 +135,16 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(effect->isActive()); // Eventually, the animation will be complete. QTRY_VERIFY(!effect->isActive()); // Close the test client, the effect should start animating the disappearing // of the client. - QSignalSpy windowClosedSpy(client, &XdgShellClient::windowClosed); + QSignalSpy windowClosedSpy(client, &AbstractClient::windowClosed); QVERIFY(windowClosedSpy.isValid()); shellSurface.reset(); surface.reset(); @@ -181,7 +179,7 @@ QVERIFY(!mainWindowSurface.isNull()); QScopedPointer mainWindowShellSurface(Test::createXdgShellStableSurface(mainWindowSurface.data())); QVERIFY(!mainWindowShellSurface.isNull()); - XdgShellClient *mainWindow = Test::renderAndWaitForShown(mainWindowSurface.data(), QSize(100, 50), Qt::blue); + AbstractClient *mainWindow = Test::renderAndWaitForShown(mainWindowSurface.data(), QSize(100, 50), Qt::blue); QVERIFY(mainWindow); // Load effect that will be tested. @@ -201,14 +199,14 @@ positioner.setAnchorEdge(Qt::BottomEdge | Qt::LeftEdge); QScopedPointer popupShellSurface(Test::createXdgShellStablePopup(popupSurface.data(), mainWindowShellSurface.data(), positioner)); QVERIFY(!popupShellSurface.isNull()); - XdgShellClient *popup = Test::renderAndWaitForShown(popupSurface.data(), positioner.initialSize(), Qt::red); + AbstractClient *popup = Test::renderAndWaitForShown(popupSurface.data(), positioner.initialSize(), Qt::red); QVERIFY(popup); QVERIFY(popup->isPopupWindow()); QCOMPARE(popup->transientFor(), mainWindow); QVERIFY(!effect->isActive()); // Destroy the popup, it should not be animated. - QSignalSpy popupClosedSpy(popup, &XdgShellClient::windowClosed); + QSignalSpy popupClosedSpy(popup, &AbstractClient::windowClosed); QVERIFY(popupClosedSpy.isValid()); popupShellSurface.reset(); popupSurface.reset(); diff --git a/autotests/integration/effects/translucency_test.cpp b/autotests/integration/effects/translucency_test.cpp --- a/autotests/integration/effects/translucency_test.cpp +++ b/autotests/integration/effects/translucency_test.cpp @@ -24,7 +24,6 @@ #include "effectloader.h" #include "cursor.h" #include "platform.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" #include "effect_builtins.h" @@ -55,7 +54,6 @@ void TranslucencyTest::initTestCase() { qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/effects/windowgeometry_test.cpp b/autotests/integration/effects/windowgeometry_test.cpp --- a/autotests/integration/effects/windowgeometry_test.cpp +++ b/autotests/integration/effects/windowgeometry_test.cpp @@ -18,12 +18,12 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "composite.h" #include "effects.h" #include "effectloader.h" #include "cursor.h" #include "platform.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" #include "effect_builtins.h" @@ -50,7 +50,6 @@ void WindowGeometryTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/effects/wobbly_shade_test.cpp b/autotests/integration/effects/wobbly_shade_test.cpp --- a/autotests/integration/effects/wobbly_shade_test.cpp +++ b/autotests/integration/effects/wobbly_shade_test.cpp @@ -25,7 +25,6 @@ #include "effectloader.h" #include "cursor.h" #include "platform.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" #include "effect_builtins.h" @@ -56,7 +55,6 @@ void WobblyWindowsShadeTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/generic_scene_opengl_test.cpp b/autotests/integration/generic_scene_opengl_test.cpp --- a/autotests/integration/generic_scene_opengl_test.cpp +++ b/autotests/integration/generic_scene_opengl_test.cpp @@ -18,12 +18,12 @@ along with this program. If not, see . *********************************************************************/ #include "generic_scene_opengl_test.h" +#include "abstract_client.h" #include "composite.h" #include "effectloader.h" #include "cursor.h" #include "platform.h" #include "scene.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "effect_builtins.h" @@ -49,7 +49,6 @@ void GenericSceneOpenGLTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/globalshortcuts_test.cpp b/autotests/integration/globalshortcuts_test.cpp --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -24,7 +24,6 @@ #include "internal_client.h" #include "platform.h" #include "screens.h" -#include "xdgshellclient.h" #include "useractions.h" #include "wayland_server.h" #include "workspace.h" @@ -65,7 +64,6 @@ { qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); diff --git a/autotests/integration/idle_inhibition_test.cpp b/autotests/integration/idle_inhibition_test.cpp --- a/autotests/integration/idle_inhibition_test.cpp +++ b/autotests/integration/idle_inhibition_test.cpp @@ -18,8 +18,8 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "platform.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -54,7 +54,6 @@ void TestIdleInhibition::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -268,7 +267,7 @@ QCOMPARE(inhibitedSpy.count(), 1); // Unmap the client. - QSignalSpy hiddenSpy(c, &XdgShellClient::windowHidden); + QSignalSpy hiddenSpy(c, &AbstractClient::windowHidden); QVERIFY(hiddenSpy.isValid()); surface->attachBuffer(Buffer::Ptr()); surface->commit(Surface::CommitFlag::None); @@ -280,7 +279,7 @@ QCOMPARE(inhibitedSpy.count(), 2); // Map the client. - QSignalSpy windowShownSpy(c, &XdgShellClient::windowShown); + QSignalSpy windowShownSpy(c, &AbstractClient::windowShown); QVERIFY(windowShownSpy.isValid()); Test::render(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(windowShownSpy.wait()); diff --git a/autotests/integration/input_stacking_order.cpp b/autotests/integration/input_stacking_order.cpp --- a/autotests/integration/input_stacking_order.cpp +++ b/autotests/integration/input_stacking_order.cpp @@ -26,7 +26,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -61,7 +60,6 @@ void InputStackingOrderTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -23,7 +23,6 @@ #include "effects.h" #include "internal_client.h" #include "screens.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -185,7 +184,6 @@ { qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); diff --git a/autotests/integration/keyboard_layout_test.cpp b/autotests/integration/keyboard_layout_test.cpp --- a/autotests/integration/keyboard_layout_test.cpp +++ b/autotests/integration/keyboard_layout_test.cpp @@ -18,10 +18,10 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "keyboard_input.h" #include "keyboard_layout.h" #include "platform.h" -#include "xdgshellclient.h" #include "virtualdesktops.h" #include "wayland_server.h" #include "workspace.h" @@ -74,7 +74,6 @@ void KeyboardLayoutTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/keymap_creation_failure_test.cpp b/autotests/integration/keymap_creation_failure_test.cpp --- a/autotests/integration/keymap_creation_failure_test.cpp +++ b/autotests/integration/keymap_creation_failure_test.cpp @@ -18,10 +18,10 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "keyboard_input.h" #include "keyboard_layout.h" #include "platform.h" -#include "xdgshellclient.h" #include "virtualdesktops.h" #include "wayland_server.h" #include "workspace.h" @@ -57,7 +57,6 @@ qputenv("XKB_DEFAULT_VARIANT", "no"); qputenv("XKB_DEFAULT_OPTIONS", "no"); - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h --- a/autotests/integration/kwin_wayland_test.h +++ b/autotests/integration/kwin_wayland_test.h @@ -58,7 +58,6 @@ } class AbstractClient; -class XdgShellClient; class WaylandTestApplication : public ApplicationWaylandAbstract { @@ -181,15 +180,15 @@ void render(KWayland::Client::Surface *surface, const QImage &img); /** - * Waits till a new XdgShellClient is shown and returns the created XdgShellClient. - * If no XdgShellClient gets shown during @p timeout @c null is returned. + * Waits till a new AbstractClient is shown and returns the created AbstractClient. + * If no AbstractClient gets shown during @p timeout @c null is returned. */ -XdgShellClient *waitForWaylandWindowShown(int timeout = 5000); +AbstractClient *waitForWaylandWindowShown(int timeout = 5000); /** * Combination of @link{render} and @link{waitForWaylandWindowShown}. */ -XdgShellClient *renderAndWaitForShown(KWayland::Client::Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format = QImage::Format_ARGB32, int timeout = 5000); +AbstractClient *renderAndWaitForShown(KWayland::Client::Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format = QImage::Format_ARGB32, int timeout = 5000); /** * Waits for the @p client to be destroyed. diff --git a/autotests/integration/kwinbindings_test.cpp b/autotests/integration/kwinbindings_test.cpp --- a/autotests/integration/kwinbindings_test.cpp +++ b/autotests/integration/kwinbindings_test.cpp @@ -18,11 +18,11 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "cursor.h" #include "input.h" #include "platform.h" #include "screens.h" -#include "xdgshellclient.h" #include "scripting/scripting.h" #include "useractions.h" #include "virtualdesktops.h" @@ -57,7 +57,6 @@ void KWinBindingsTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -27,7 +27,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -183,7 +182,6 @@ void LockScreenTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/maximize_test.cpp b/autotests/integration/maximize_test.cpp --- a/autotests/integration/maximize_test.cpp +++ b/autotests/integration/maximize_test.cpp @@ -18,11 +18,11 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "cursor.h" #include "decorations/decorationbridge.h" #include "decorations/settings.h" #include "platform.h" -#include "xdgshellclient.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" @@ -61,7 +61,6 @@ void TestMaximized::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); @@ -202,7 +201,7 @@ // Now let's render in an incorrect size. shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QCOMPARE(client->frameGeometry(), QRect(0, 0, 100, 50)); QEXPECT_FAIL("", "Should go out of maximzied", Continue); @@ -249,7 +248,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); @@ -326,7 +325,7 @@ auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); - QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy sizeChangeRequestedSpy(xdgShellSurface.data(), &XdgShellSurface::sizeChanged); QVERIFY(sizeChangeRequestedSpy.isValid()); diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -28,7 +28,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include "deleted.h" #include @@ -94,7 +93,6 @@ { qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType("MaximizeMode"); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); @@ -814,7 +812,7 @@ QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); // and close - QSignalSpy windowClosedSpy(testWindow, &XdgShellClient::windowClosed); + QSignalSpy windowClosedSpy(testWindow, &AbstractClient::windowClosed); QVERIFY(windowClosedSpy.isValid()); shellSurface.reset(); surface.reset(); @@ -880,7 +878,7 @@ QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); // and destroy the panel again - QSignalSpy panelClosedSpy(panel, &XdgShellClient::windowClosed); + QSignalSpy panelClosedSpy(panel, &AbstractClient::windowClosed); QVERIFY(panelClosedSpy.isValid()); plasmaSurface.reset(); panelShellSurface.reset(); @@ -891,7 +889,7 @@ QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); // and close - QSignalSpy windowClosedSpy(testWindow, &XdgShellClient::windowClosed); + QSignalSpy windowClosedSpy(testWindow, &AbstractClient::windowClosed); QVERIFY(windowClosedSpy.isValid()); shellSurface.reset(); surface.reset(); @@ -918,7 +916,7 @@ QVERIFY(configureRequestedSpy.wait()); client->move(100, 300); - QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); @@ -961,7 +959,7 @@ QVERIFY(configureRequestedSpy.wait()); client->move(100, 300); - QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); @@ -1012,7 +1010,7 @@ QVERIFY(configureRequestedSpy.wait()); client->move(100, 300); - QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); @@ -1053,7 +1051,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); // Start moving the client. @@ -1090,7 +1088,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); // Start resizing the client. @@ -1127,7 +1125,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); // Start resizing the client. @@ -1146,7 +1144,7 @@ QCOMPARE(client->isResize(), false); // Unmap the client while we're moving it. - QSignalSpy hiddenSpy(client, &XdgShellClient::windowHidden); + QSignalSpy hiddenSpy(client, &AbstractClient::windowHidden); QVERIFY(hiddenSpy.isValid()); surface->attachBuffer(Buffer::Ptr()); surface->commit(Surface::CommitFlag::None); @@ -1173,7 +1171,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); // Start resizing the client. @@ -1192,7 +1190,7 @@ QCOMPARE(client->isResize(), true); // Unmap the client while we're resizing it. - QSignalSpy hiddenSpy(client, &XdgShellClient::windowHidden); + QSignalSpy hiddenSpy(client, &AbstractClient::windowHidden); QVERIFY(hiddenSpy.isValid()); surface->attachBuffer(Buffer::Ptr()); surface->commit(Surface::CommitFlag::None); diff --git a/autotests/integration/placement_test.cpp b/autotests/integration/placement_test.cpp --- a/autotests/integration/placement_test.cpp +++ b/autotests/integration/placement_test.cpp @@ -18,11 +18,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ +#include "abstract_client.h" #include "cursor.h" #include "kwin_wayland_test.h" #include "platform.h" #include "screens.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -90,7 +90,6 @@ void TestPlacement::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); @@ -251,7 +250,7 @@ QScopedPointer surface(Test::createSurface()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); QVERIFY(client); QCOMPARE(client->frameGeometry(), QRect(590, 487, 100, 50)); @@ -273,7 +272,7 @@ QScopedPointer surface(Test::createSurface()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); QVERIFY(client); QCOMPARE(client->frameGeometry(), QRect(151, 276, 100, 50)); @@ -292,21 +291,21 @@ QScopedPointer surface1(Test::createSurface()); QScopedPointer shellSurface1(Test::createXdgShellStableSurface(surface1.data())); - XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::red); + AbstractClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::red); QVERIFY(client1); QCOMPARE(client1->pos(), QPoint(0, 0)); QCOMPARE(client1->size(), QSize(100, 50)); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); - XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); + AbstractClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); QVERIFY(client2); QCOMPARE(client2->pos(), client1->pos() + workspace()->cascadeOffset(client2)); QCOMPARE(client2->size(), QSize(100, 50)); QScopedPointer surface3(Test::createSurface()); QScopedPointer shellSurface3(Test::createXdgShellStableSurface(surface3.data())); - XdgShellClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::green); + AbstractClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::green); QVERIFY(client3); QCOMPARE(client3->pos(), client2->pos() + workspace()->cascadeOffset(client3)); QCOMPARE(client3->size(), QSize(100, 50)); @@ -330,20 +329,20 @@ QScopedPointer surface1(Test::createSurface()); QScopedPointer shellSurface1(Test::createXdgShellStableSurface(surface1.data())); - XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::red); + AbstractClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::red); QVERIFY(client1); QCOMPARE(client1->size(), QSize(100, 50)); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); - XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); + AbstractClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); QVERIFY(client2); QVERIFY(client2->pos() != client1->pos()); QCOMPARE(client2->size(), QSize(100, 50)); QScopedPointer surface3(Test::createSurface()); QScopedPointer shellSurface3(Test::createXdgShellStableSurface(surface3.data())); - XdgShellClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::green); + AbstractClient *client3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::green); QVERIFY(client3); QVERIFY(client3->pos() != client1->pos()); QVERIFY(client3->pos() != client2->pos()); diff --git a/autotests/integration/plasma_surface_test.cpp b/autotests/integration/plasma_surface_test.cpp --- a/autotests/integration/plasma_surface_test.cpp +++ b/autotests/integration/plasma_surface_test.cpp @@ -18,9 +18,9 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "platform.h" #include "cursor.h" -#include "xdgshellclient.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" @@ -70,7 +70,7 @@ void PlasmaSurfaceTest::initTestCase() { - qRegisterMetaType(); + qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -25,7 +25,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -68,7 +67,6 @@ void PlasmaWindowTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); @@ -245,7 +243,7 @@ // first create the parent window QScopedPointer parentSurface(Test::createSurface()); QScopedPointer parentShellSurface(Test::createXdgShellStableSurface(parentSurface.data())); - XdgShellClient *parentClient = Test::renderAndWaitForShown(parentSurface.data(), QSize(100, 50), Qt::blue); + AbstractClient *parentClient = Test::renderAndWaitForShown(parentSurface.data(), QSize(100, 50), Qt::blue); QVERIFY(parentClient); QVERIFY(plasmaWindowCreatedSpy.wait()); QCOMPARE(plasmaWindowCreatedSpy.count(), 1); @@ -256,7 +254,7 @@ positioner.setGravity(Qt::BottomEdge | Qt::RightEdge); QScopedPointer popupSurface(Test::createSurface()); QScopedPointer popupShellSurface(Test::createXdgShellStablePopup(popupSurface.data(), parentShellSurface.data(), positioner)); - XdgShellClient *popupClient = Test::renderAndWaitForShown(popupSurface.data(), positioner.initialSize(), Qt::blue); + AbstractClient *popupClient = Test::renderAndWaitForShown(popupSurface.data(), positioner.initialSize(), Qt::blue); QVERIFY(popupClient); QVERIFY(!plasmaWindowCreatedSpy.wait(100)); QCOMPARE(plasmaWindowCreatedSpy.count(), 1); @@ -280,7 +278,7 @@ // lock ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate); QVERIFY(clientAddedSpy.wait()); - QVERIFY(clientAddedSpy.first().first().value()->isLockScreen()); + QVERIFY(clientAddedSpy.first().first().value()->isLockScreen()); // should not be sent to the client QVERIFY(plasmaWindowCreatedSpy.isEmpty()); QVERIFY(!plasmaWindowCreatedSpy.wait()); diff --git a/autotests/integration/pointer_constraints_test.cpp b/autotests/integration/pointer_constraints_test.cpp --- a/autotests/integration/pointer_constraints_test.cpp +++ b/autotests/integration/pointer_constraints_test.cpp @@ -18,11 +18,11 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "cursor.h" #include "keyboard_input.h" #include "platform.h" #include "pointer_input.h" -#include "xdgshellclient.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" @@ -69,7 +69,6 @@ void TestPointerConstraints::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -30,7 +30,6 @@ #include "wayland_cursor_theme.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -140,7 +139,6 @@ void PointerInputTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -1209,7 +1207,7 @@ popupShellSurface->requestGrab(Test::waylandSeat(), 0); // FIXME: Serial. render(popupSurface, positioner.initialSize()); QVERIFY(clientAddedSpy.wait()); - auto popupClient = clientAddedSpy.last().first().value(); + auto popupClient = clientAddedSpy.last().first().value(); QVERIFY(popupClient); QVERIFY(popupClient != window); QCOMPARE(window, workspace()->activeClient()); @@ -1300,7 +1298,7 @@ popupShellSurface->requestGrab(Test::waylandSeat(), 0); // FIXME: Serial. render(popupSurface, positioner.initialSize()); QVERIFY(clientAddedSpy.wait()); - auto popupClient = clientAddedSpy.last().first().value(); + auto popupClient = clientAddedSpy.last().first().value(); QVERIFY(popupClient); QVERIFY(popupClient != window); QCOMPARE(window, workspace()->activeClient()); @@ -1362,7 +1360,7 @@ QVERIFY(popupShellSurface); render(popupSurface, positioner.initialSize()); QVERIFY(clientAddedSpy.wait()); - auto popupClient = clientAddedSpy.last().first().value(); + auto popupClient = clientAddedSpy.last().first().value(); QVERIFY(popupClient); QVERIFY(popupClient != window); QVERIFY(window->frameGeometry().contains(Cursor::pos())); @@ -1501,7 +1499,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); // move the cursor to the test position @@ -1571,7 +1569,7 @@ QVERIFY(!surface.isNull()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); - XdgShellClient *c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); // move cursor to the test position diff --git a/autotests/integration/quick_tiling_test.cpp b/autotests/integration/quick_tiling_test.cpp --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -27,7 +27,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include "scripting/scripting.h" #include @@ -92,7 +91,6 @@ void QuickTilingTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType("MaximizeMode"); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/scene_opengl_shadow_test.cpp b/autotests/integration/scene_opengl_shadow_test.cpp --- a/autotests/integration/scene_opengl_shadow_test.cpp +++ b/autotests/integration/scene_opengl_shadow_test.cpp @@ -38,13 +38,13 @@ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "composite.h" #include "effect_builtins.h" #include "effectloader.h" #include "effects.h" #include "platform.h" #include "shadow.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -112,7 +112,6 @@ { // Copied from generic_scene_opengl_test.cpp - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/scene_qpainter_shadow_test.cpp b/autotests/integration/scene_qpainter_shadow_test.cpp --- a/autotests/integration/scene_qpainter_shadow_test.cpp +++ b/autotests/integration/scene_qpainter_shadow_test.cpp @@ -42,14 +42,14 @@ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "composite.h" #include "effect_builtins.h" #include "effectloader.h" #include "effects.h" #include "platform.h" #include "plugins/scenes/qpainter/scene_qpainter.h" #include "shadow.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -116,7 +116,6 @@ { // Copied from scene_qpainter_test.cpp - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/scene_qpainter_test.cpp b/autotests/integration/scene_qpainter_test.cpp --- a/autotests/integration/scene_qpainter_test.cpp +++ b/autotests/integration/scene_qpainter_test.cpp @@ -24,7 +24,6 @@ #include "cursor.h" #include "effects.h" #include "platform.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "effect_builtins.h" #include "workspace.h" @@ -68,7 +67,6 @@ void SceneQPainterTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/screenedge_client_show_test.cpp b/autotests/integration/screenedge_client_show_test.cpp --- a/autotests/integration/screenedge_client_show_test.cpp +++ b/autotests/integration/screenedge_client_show_test.cpp @@ -26,7 +26,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -51,7 +50,6 @@ void ScreenEdgeClientShowTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/scripting/minimizeall_test.cpp b/autotests/integration/scripting/minimizeall_test.cpp --- a/autotests/integration/scripting/minimizeall_test.cpp +++ b/autotests/integration/scripting/minimizeall_test.cpp @@ -20,12 +20,12 @@ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "platform.h" #include "screens.h" #include "scripting/scripting.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -55,7 +55,6 @@ qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); @@ -122,14 +121,14 @@ // Create a couple of test clients. QScopedPointer surface1(Test::createSurface()); QScopedPointer shellSurface1(Test::createXdgShellStableSurface(surface1.data())); - XdgShellClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); + AbstractClient *client1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue); QVERIFY(client1); QVERIFY(client1->isActive()); QVERIFY(client1->isMinimizable()); QScopedPointer surface2(Test::createSurface()); QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); - XdgShellClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::red); + AbstractClient *client2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::red); QVERIFY(client2); QVERIFY(client2->isActive()); QVERIFY(client2->isMinimizable()); diff --git a/autotests/integration/shade_test.cpp b/autotests/integration/shade_test.cpp --- a/autotests/integration/shade_test.cpp +++ b/autotests/integration/shade_test.cpp @@ -25,7 +25,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -49,7 +48,6 @@ void ShadeTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/showing_desktop_test.cpp b/autotests/integration/showing_desktop_test.cpp --- a/autotests/integration/showing_desktop_test.cpp +++ b/autotests/integration/showing_desktop_test.cpp @@ -18,8 +18,8 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "platform.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -45,7 +45,6 @@ void ShowingDesktopTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/stacking_order_test.cpp b/autotests/integration/stacking_order_test.cpp --- a/autotests/integration/stacking_order_test.cpp +++ b/autotests/integration/stacking_order_test.cpp @@ -26,7 +26,6 @@ #include "deleted.h" #include "main.h" #include "platform.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -67,7 +66,6 @@ { qRegisterMetaType(); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); @@ -102,7 +100,7 @@ KWayland::Client::XdgShellSurface *parentShellSurface = Test::createXdgShellStableSurface(parentSurface, parentSurface); QVERIFY(parentShellSurface); - XdgShellClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); + AbstractClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); QVERIFY(parent); QVERIFY(parent->isActive()); QVERIFY(!parent->isTransient()); @@ -118,7 +116,7 @@ Test::createXdgShellStableSurface(transientSurface, transientSurface); QVERIFY(transientShellSurface); transientShellSurface->setTransientFor(parentShellSurface); - XdgShellClient *transient = Test::renderAndWaitForShown( + AbstractClient *transient = Test::renderAndWaitForShown( transientSurface, QSize(128, 128), Qt::red); QVERIFY(transient); QVERIFY(transient->isActive()); @@ -146,7 +144,7 @@ KWayland::Client::XdgShellSurface *parentShellSurface = Test::createXdgShellStableSurface(parentSurface, parentSurface); QVERIFY(parentShellSurface); - XdgShellClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); + AbstractClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); QVERIFY(parent); QVERIFY(parent->isActive()); QVERIFY(!parent->isTransient()); @@ -162,7 +160,7 @@ Test::createXdgShellStableSurface(transientSurface, transientSurface); QVERIFY(transientShellSurface); transientShellSurface->setTransientFor(parentShellSurface); - XdgShellClient *transient = Test::renderAndWaitForShown( + AbstractClient *transient = Test::renderAndWaitForShown( transientSurface, QSize(128, 128), Qt::red); QVERIFY(transient); QTRY_VERIFY(transient->isActive()); @@ -178,7 +176,7 @@ KWayland::Client::XdgShellSurface *anotherShellSurface = Test::createXdgShellStableSurface(anotherSurface, anotherSurface); QVERIFY(anotherShellSurface); - XdgShellClient *anotherClient = Test::renderAndWaitForShown(anotherSurface, QSize(128, 128), Qt::green); + AbstractClient *anotherClient = Test::renderAndWaitForShown(anotherSurface, QSize(128, 128), Qt::green); QVERIFY(anotherClient); QVERIFY(anotherClient->isActive()); QVERIFY(!anotherClient->isTransient()); @@ -229,7 +227,7 @@ KWayland::Client::XdgShellSurface *parentShellSurface = Test::createXdgShellStableSurface(parentSurface, parentSurface); QVERIFY(parentShellSurface); - XdgShellClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); + AbstractClient *parent = Test::renderAndWaitForShown(parentSurface, QSize(256, 256), Qt::blue); QVERIFY(parent); QVERIFY(parent->isActive()); QVERIFY(!parent->isTransient()); @@ -244,7 +242,7 @@ Test::createXdgShellStableSurface(transient1Surface, transient1Surface); QVERIFY(transient1ShellSurface); transient1ShellSurface->setTransientFor(parentShellSurface); - XdgShellClient *transient1 = Test::renderAndWaitForShown( + AbstractClient *transient1 = Test::renderAndWaitForShown( transient1Surface, QSize(128, 128), Qt::red); QVERIFY(transient1); QTRY_VERIFY(transient1->isActive()); @@ -261,7 +259,7 @@ Test::createXdgShellStableSurface(transient2Surface, transient2Surface); QVERIFY(transient2ShellSurface); transient2ShellSurface->setTransientFor(transient1ShellSurface); - XdgShellClient *transient2 = Test::renderAndWaitForShown( + AbstractClient *transient2 = Test::renderAndWaitForShown( transient2Surface, QSize(128, 128), Qt::red); QVERIFY(transient2); QTRY_VERIFY(transient2->isActive()); @@ -277,14 +275,14 @@ QTRY_VERIFY(!transient2->isActive()); // Close the top-most transient. - connect(transient2, &XdgShellClient::windowClosed, this, + connect(transient2, &AbstractClient::windowClosed, this, [](Toplevel *toplevel, Deleted *deleted) { Q_UNUSED(toplevel) deleted->refWindow(); } ); - QSignalSpy windowClosedSpy(transient2, &XdgShellClient::windowClosed); + QSignalSpy windowClosedSpy(transient2, &AbstractClient::windowClosed); QVERIFY(windowClosedSpy.isValid()); delete transient2ShellSurface; delete transient2Surface; @@ -571,7 +569,7 @@ KWayland::Client::XdgShellSurface *anotherShellSurface = Test::createXdgShellStableSurface(anotherSurface, anotherSurface); QVERIFY(anotherShellSurface); - XdgShellClient *anotherClient = Test::renderAndWaitForShown(anotherSurface, QSize(128, 128), Qt::green); + AbstractClient *anotherClient = Test::renderAndWaitForShown(anotherSurface, QSize(128, 128), Qt::green); QVERIFY(anotherClient); QVERIFY(anotherClient->isActive()); QVERIFY(!anotherClient->isTransient()); @@ -826,7 +824,7 @@ KWayland::Client::XdgShellSurface *clientAShellSurface = Test::createXdgShellStableSurface(clientASurface, clientASurface); QVERIFY(clientAShellSurface); - XdgShellClient *clientA = Test::renderAndWaitForShown(clientASurface, QSize(128, 128), Qt::green); + AbstractClient *clientA = Test::renderAndWaitForShown(clientASurface, QSize(128, 128), Qt::green); QVERIFY(clientA); QVERIFY(clientA->isActive()); QVERIFY(!clientA->keepAbove()); @@ -840,7 +838,7 @@ KWayland::Client::XdgShellSurface *clientBShellSurface = Test::createXdgShellStableSurface(clientBSurface, clientBSurface); QVERIFY(clientBShellSurface); - XdgShellClient *clientB = Test::renderAndWaitForShown(clientBSurface, QSize(128, 128), Qt::green); + AbstractClient *clientB = Test::renderAndWaitForShown(clientBSurface, QSize(128, 128), Qt::green); QVERIFY(clientB); QVERIFY(clientB->isActive()); QVERIFY(!clientB->keepAbove()); @@ -874,7 +872,7 @@ KWayland::Client::XdgShellSurface *clientAShellSurface = Test::createXdgShellStableSurface(clientASurface, clientASurface); QVERIFY(clientAShellSurface); - XdgShellClient *clientA = Test::renderAndWaitForShown(clientASurface, QSize(128, 128), Qt::green); + AbstractClient *clientA = Test::renderAndWaitForShown(clientASurface, QSize(128, 128), Qt::green); QVERIFY(clientA); QVERIFY(clientA->isActive()); QVERIFY(!clientA->keepBelow()); @@ -888,7 +886,7 @@ KWayland::Client::XdgShellSurface *clientBShellSurface = Test::createXdgShellStableSurface(clientBSurface, clientBSurface); QVERIFY(clientBShellSurface); - XdgShellClient *clientB = Test::renderAndWaitForShown(clientBSurface, QSize(128, 128), Qt::green); + AbstractClient *clientB = Test::renderAndWaitForShown(clientBSurface, QSize(128, 128), Qt::green); QVERIFY(clientB); QVERIFY(clientB->isActive()); QVERIFY(!clientB->keepBelow()); diff --git a/autotests/integration/struts_test.cpp b/autotests/integration/struts_test.cpp --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -26,7 +26,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -67,7 +66,6 @@ void StrutsTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -168,7 +166,7 @@ QFETCH(QVector, windowGeometries); // create the panels - QHash clients; + QHash clients; for (auto it = windowGeometries.constBegin(), end = windowGeometries.constEnd(); it != end; it++) { const QRect windowGeometry = *it; Surface *surface = Test::createSurface(m_compositor); @@ -246,7 +244,7 @@ QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024)); QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1000)); - QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); plasmaSurface->setPosition(QPoint(1280, 1000)); QVERIFY(frameGeometryChangedSpy.wait()); diff --git a/autotests/integration/tabbox_test.cpp b/autotests/integration/tabbox_test.cpp --- a/autotests/integration/tabbox_test.cpp +++ b/autotests/integration/tabbox_test.cpp @@ -18,11 +18,11 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "cursor.h" #include "input.h" #include "platform.h" #include "screens.h" -#include "xdgshellclient.h" #include "tabbox/tabbox.h" #include "wayland_server.h" #include "workspace.h" @@ -52,7 +52,6 @@ void TabBoxTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp --- a/autotests/integration/test_helpers.cpp +++ b/autotests/integration/test_helpers.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "xdgshellclient.h" +#include "abstract_client.h" #include "screenlockerwatcher.h" #include "wayland_server.h" @@ -392,19 +392,19 @@ surface->commit(Surface::CommitFlag::None); } -XdgShellClient *waitForWaylandWindowShown(int timeout) +AbstractClient *waitForWaylandWindowShown(int timeout) { QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded); if (!clientAddedSpy.isValid()) { return nullptr; } if (!clientAddedSpy.wait(timeout)) { return nullptr; } - return clientAddedSpy.first().first().value(); + return clientAddedSpy.first().first().value(); } -XdgShellClient *renderAndWaitForShown(Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format, int timeout) +AbstractClient *renderAndWaitForShown(Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format, int timeout) { QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded); if (!clientAddedSpy.isValid()) { @@ -415,7 +415,7 @@ if (!clientAddedSpy.wait(timeout)) { return nullptr; } - return clientAddedSpy.first().first().value(); + return clientAddedSpy.first().first().value(); } void flushWaylandConnection() diff --git a/autotests/integration/touch_input_test.cpp b/autotests/integration/touch_input_test.cpp --- a/autotests/integration/touch_input_test.cpp +++ b/autotests/integration/touch_input_test.cpp @@ -18,9 +18,9 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "platform.h" #include "cursor.h" -#include "xdgshellclient.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" @@ -57,7 +57,6 @@ void TouchInputTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/transient_placement.cpp b/autotests/integration/transient_placement.cpp --- a/autotests/integration/transient_placement.cpp +++ b/autotests/integration/transient_placement.cpp @@ -25,7 +25,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -63,7 +62,6 @@ void TransientPlacementTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); @@ -340,7 +338,7 @@ parent->setFullScreen(true); QVERIFY(fullscreenSpy.wait()); parentShellSurface->ackConfigure(fullscreenSpy.first().at(2).value()); - QSignalSpy frameGeometryChangedSpy{parent, &XdgShellClient::frameGeometryChanged}; + QSignalSpy frameGeometryChangedSpy{parent, &AbstractClient::frameGeometryChanged}; QVERIFY(frameGeometryChangedSpy.isValid()); Test::render(parentSurface, fullscreenSpy.first().at(0).toSize(), Qt::red); QVERIFY(frameGeometryChangedSpy.wait()); diff --git a/autotests/integration/virtual_desktop_test.cpp b/autotests/integration/virtual_desktop_test.cpp --- a/autotests/integration/virtual_desktop_test.cpp +++ b/autotests/integration/virtual_desktop_test.cpp @@ -18,10 +18,10 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "main.h" #include "platform.h" #include "screens.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "virtualdesktops.h" @@ -51,7 +51,6 @@ void VirtualDesktopTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); @@ -157,7 +156,7 @@ QVERIFY(client); QCOMPARE(client->desktop(), 2); - QSignalSpy desktopPresenceChangedSpy(client, &XdgShellClient::desktopPresenceChanged); + QSignalSpy desktopPresenceChangedSpy(client, &AbstractClient::desktopPresenceChanged); QVERIFY(desktopPresenceChangedSpy.isValid()); QCOMPARE(client->desktops().count(), 1u); @@ -201,7 +200,7 @@ QVERIFY(client); QCOMPARE(client->desktop(), 3u); - QSignalSpy desktopPresenceChangedSpy(client, &XdgShellClient::desktopPresenceChanged); + QSignalSpy desktopPresenceChangedSpy(client, &AbstractClient::desktopPresenceChanged); QVERIFY(desktopPresenceChangedSpy.isValid()); QCOMPARE(client->desktops().count(), 1u); @@ -289,7 +288,7 @@ QVERIFY(client); QCOMPARE(client->desktop(), 3u); - QSignalSpy desktopPresenceChangedSpy(client, &XdgShellClient::desktopPresenceChanged); + QSignalSpy desktopPresenceChangedSpy(client, &AbstractClient::desktopPresenceChanged); QVERIFY(desktopPresenceChangedSpy.isValid()); QCOMPARE(client->desktops().count(), 1u); diff --git a/autotests/integration/window_rules_test.cpp b/autotests/integration/window_rules_test.cpp --- a/autotests/integration/window_rules_test.cpp +++ b/autotests/integration/window_rules_test.cpp @@ -28,7 +28,6 @@ #include "rules.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include #include @@ -52,7 +51,6 @@ void WindowRuleTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/window_selection_test.cpp b/autotests/integration/window_selection_test.cpp --- a/autotests/integration/window_selection_test.cpp +++ b/autotests/integration/window_selection_test.cpp @@ -18,11 +18,11 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "cursor.h" #include "keyboard_input.h" #include "platform.h" #include "pointer_input.h" -#include "xdgshellclient.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" @@ -63,7 +63,6 @@ void TestWindowSelection::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/x11_client_test.cpp b/autotests/integration/x11_client_test.cpp --- a/autotests/integration/x11_client_test.cpp +++ b/autotests/integration/x11_client_test.cpp @@ -27,7 +27,6 @@ #include "deleted.h" #include "platform.h" #include "screens.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "workspace.h" @@ -66,7 +65,6 @@ void X11ClientTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); diff --git a/autotests/integration/xdgshellclient_rules_test.cpp b/autotests/integration/xdgshellclient_rules_test.cpp --- a/autotests/integration/xdgshellclient_rules_test.cpp +++ b/autotests/integration/xdgshellclient_rules_test.cpp @@ -21,11 +21,11 @@ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "cursor.h" #include "platform.h" #include "rules.h" #include "screens.h" -#include "xdgshellclient.h" #include "virtualdesktops.h" #include "wayland_server.h" #include "workspace.h" @@ -224,7 +224,6 @@ void TestXdgShellClientRules::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -270,7 +269,7 @@ QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; \ } -std::tuple createWindow(Test::XdgShellSurfaceType type, const QByteArray &appId) +std::tuple createWindow(Test::XdgShellSurfaceType type, const QByteArray &appId) { // Create an xdg surface. Surface *surface = Test::createSurface(); @@ -286,7 +285,7 @@ // Draw content of the surface. shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); return {client, surface, shellSurface}; } @@ -310,7 +309,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -348,7 +347,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -427,7 +426,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -506,7 +505,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -553,7 +552,7 @@ { // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; QObject *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -647,7 +646,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -723,7 +722,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isResizable()); @@ -778,7 +777,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isResizable()); @@ -916,7 +915,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isResizable()); @@ -1050,7 +1049,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(!client->isResizable()); @@ -1125,7 +1124,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isResizable()); @@ -1207,7 +1206,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(480, 640), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(!client->isResizable()); @@ -1301,7 +1300,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isMaximizable()); @@ -1363,7 +1362,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isMaximizable()); @@ -1475,7 +1474,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isMaximizable()); @@ -1587,7 +1586,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(!client->isMaximizable()); @@ -1674,7 +1673,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isMaximizable()); @@ -1796,7 +1795,7 @@ // Map the client. shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value()); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(1280, 1024), Qt::blue); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(!client->isMaximizable()); @@ -1882,7 +1881,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -1923,7 +1922,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -1980,7 +1979,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2033,7 +2032,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2077,7 +2076,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2143,7 +2142,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2202,7 +2201,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2237,7 +2236,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2285,7 +2284,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2331,7 +2330,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2366,7 +2365,7 @@ { // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2425,7 +2424,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2473,7 +2472,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2507,7 +2506,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2553,7 +2552,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2601,7 +2600,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2636,7 +2635,7 @@ { // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2692,7 +2691,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2742,7 +2741,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2776,7 +2775,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2822,7 +2821,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2870,7 +2869,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2905,7 +2904,7 @@ { // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -2961,7 +2960,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3011,7 +3010,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3045,7 +3044,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3091,7 +3090,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3139,7 +3138,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3174,7 +3173,7 @@ { // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3230,7 +3229,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3280,7 +3279,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3314,7 +3313,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3360,7 +3359,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3406,7 +3405,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3439,7 +3438,7 @@ { // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3495,7 +3494,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3547,7 +3546,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3581,7 +3580,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3627,7 +3626,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3673,7 +3672,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3706,7 +3705,7 @@ { // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3762,7 +3761,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3814,7 +3813,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3861,7 +3860,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -3946,7 +3945,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -4019,7 +4018,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -4077,7 +4076,7 @@ { // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -4158,7 +4157,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -4287,7 +4286,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -4322,7 +4321,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -4355,7 +4354,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -4397,7 +4396,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -4436,7 +4435,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); @@ -4476,7 +4475,7 @@ // Create the test client. QFETCH(Test::XdgShellSurfaceType, type); - XdgShellClient *client; + AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -19,13 +19,13 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "cursor.h" #include "decorations/decorationbridge.h" #include "decorations/settings.h" #include "effects.h" #include "deleted.h" #include "platform.h" -#include "xdgshellclient.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" @@ -126,7 +126,6 @@ void TestXdgShellClient::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); @@ -186,7 +185,7 @@ QVERIFY(clientAddedSpy.isEmpty()); QVERIFY(clientAddedSpy.wait()); - auto client = clientAddedSpy.first().first().value(); + auto client = clientAddedSpy.first().first().value(); QVERIFY(client); QVERIFY(client->isShown(true)); QCOMPARE(client->isHiddenInternal(), false); @@ -212,12 +211,12 @@ QUuid deletedUuid; QCOMPARE(deletedUuid.isNull(), true); - connect(client, &XdgShellClient::windowClosed, this, [&deletedUuid] (Toplevel *, Deleted *d) { deletedUuid = d->internalId(); }); + connect(client, &AbstractClient::windowClosed, this, [&deletedUuid] (Toplevel *, Deleted *d) { deletedUuid = d->internalId(); }); // now unmap - QSignalSpy hiddenSpy(client, &XdgShellClient::windowHidden); + QSignalSpy hiddenSpy(client, &AbstractClient::windowHidden); QVERIFY(hiddenSpy.isValid()); - QSignalSpy windowClosedSpy(client, &XdgShellClient::windowClosed); + QSignalSpy windowClosedSpy(client, &AbstractClient::windowClosed); QVERIFY(windowClosedSpy.isValid()); surface->attachBuffer(Buffer::Ptr()); surface->commit(Surface::CommitFlag::None); @@ -229,7 +228,7 @@ QCOMPARE(effectsWindowHiddenSpy.count(), 1); QCOMPARE(effectsWindowHiddenSpy.first().first().value(), client->effectWindow()); - QSignalSpy windowShownSpy(client, &XdgShellClient::windowShown); + QSignalSpy windowShownSpy(client, &AbstractClient::windowShown); QVERIFY(windowShownSpy.isValid()); Test::render(surface.data(), QSize(100, 50), Qt::blue, QImage::Format_RGB32); QCOMPARE(clientAddedSpy.count(), 1); @@ -274,7 +273,7 @@ QVERIFY(c); QCOMPARE(c->desktop(), 1); effects->setNumberOfDesktops(4); - QSignalSpy desktopPresenceChangedClientSpy(c, &XdgShellClient::desktopPresenceChanged); + QSignalSpy desktopPresenceChangedClientSpy(c, &AbstractClient::desktopPresenceChanged); QVERIFY(desktopPresenceChangedClientSpy.isValid()); QSignalSpy desktopPresenceChangedWorkspaceSpy(workspace(), &Workspace::desktopPresenceChanged); QVERIFY(desktopPresenceChangedWorkspaceSpy.isValid()); @@ -318,7 +317,7 @@ QCOMPARE(transient->frameGeometry(), QRect(c->frameGeometry().topLeft() + QPoint(5, 10), QSize(50, 40))); // unmap the transient - QSignalSpy windowHiddenSpy(transient, &XdgShellClient::windowHidden); + QSignalSpy windowHiddenSpy(transient, &AbstractClient::windowHidden); QVERIFY(windowHiddenSpy.isValid()); transientSurface->attachBuffer(Buffer::Ptr()); transientSurface->commit(Surface::CommitFlag::None); @@ -328,7 +327,7 @@ c->setFrameGeometry(c->frameGeometry().translated(5, 10)); // now map the transient again - QSignalSpy windowShownSpy(transient, &XdgShellClient::windowShown); + QSignalSpy windowShownSpy(transient, &AbstractClient::windowShown); QVERIFY(windowShownSpy.isValid()); Test::render(transientSurface.data(), QSize(50, 40), Qt::blue); QVERIFY(windowShownSpy.wait()); @@ -459,9 +458,9 @@ QCOMPARE(c->clientSize(), QSize(100, 50)); QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server); QCOMPARE(c->clientSizeToFrameSize(c->clientSize()), c->frameGeometry().size()); - QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged); + QSignalSpy fullscreenChangedSpy(c, &AbstractClient::fullScreenChanged); QVERIFY(fullscreenChangedSpy.isValid()); - QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy sizeChangeRequestedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); QVERIFY(sizeChangeRequestedSpy.isValid()); @@ -535,9 +534,9 @@ configureRequestedSpy.wait(100); - QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged); + QSignalSpy fullscreenChangedSpy(c, &AbstractClient::fullScreenChanged); QVERIFY(fullscreenChangedSpy.isValid()); - QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); // swap back to normal @@ -678,9 +677,9 @@ QVERIFY(!c->isFullScreen()); QCOMPARE(c->clientSize(), QSize(100, 50)); QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server); - QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged); + QSignalSpy fullscreenChangedSpy(c, &AbstractClient::fullScreenChanged); QVERIFY(fullscreenChangedSpy.isValid()); - QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); QSignalSpy sizeChangeRequestedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); QVERIFY(sizeChangeRequestedSpy.isValid()); @@ -826,7 +825,7 @@ QSignalSpy desktopFileNameChangedSpy(c, &AbstractClient::desktopFileNameChanged); QVERIFY(desktopFileNameChangedSpy.isValid()); - QSignalSpy iconChangedSpy(c, &XdgShellClient::iconChanged); + QSignalSpy iconChangedSpy(c, &AbstractClient::iconChanged); QVERIFY(iconChangedSpy.isValid()); shellSurface->setAppId(QByteArrayLiteral("org.kde.bar")); QVERIFY(desktopFileNameChangedSpy.wait()); @@ -897,7 +896,7 @@ QCOMPARE(c4->caption(), QStringLiteral("bar")); QCOMPARE(c4->captionNormal(), QStringLiteral("bar")); QCOMPARE(c4->captionSuffix(), QString()); - QSignalSpy captionChangedSpy(c4, &XdgShellClient::captionChanged); + QSignalSpy captionChangedSpy(c4, &AbstractClient::captionChanged); QVERIFY(captionChangedSpy.isValid()); shellSurface4->setTitle(QStringLiteral("foo")); QVERIFY(captionChangedSpy.wait()); @@ -1022,7 +1021,7 @@ auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QScopedPointer menu(Test::waylandAppMenuManager()->create(surface.data())); - QSignalSpy spy(c, &XdgShellClient::hasApplicationMenuChanged); + QSignalSpy spy(c, &AbstractClient::hasApplicationMenuChanged); menu->setAddress("service.name", "object/path"); spy.wait(); QCOMPARE(c->hasApplicationMenu(), true); @@ -1311,7 +1310,7 @@ QScopedPointer surface(Test::createSurface()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); QVERIFY(client); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); QCOMPARE(client->frameGeometry().size(), QSize(200, 100)); @@ -1349,7 +1348,7 @@ QScopedPointer surface(Test::createSurface()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); QVERIFY(client); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); QCOMPARE(client->frameGeometry().size(), QSize(200, 100)); @@ -1396,14 +1395,14 @@ QScopedPointer surface(Test::createSurface()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); QVERIFY(client); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); QCOMPARE(client->frameGeometry().size(), QSize(200, 100)); const QPoint oldPosition = client->pos(); - QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); + QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); QVERIFY(frameGeometryChangedSpy.isValid()); shellSurface->setWindowGeometry(QRect(10, 10, 180, 80)); surface->commit(Surface::CommitFlag::None); @@ -1440,7 +1439,7 @@ QScopedPointer surface(Test::createSurface()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); @@ -1535,7 +1534,7 @@ QScopedPointer surface(Test::createSurface()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); @@ -1591,7 +1590,7 @@ QScopedPointer surface(Test::createSurface()); QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); - XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); + AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(200, 100), Qt::red); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->bufferGeometry().size(), QSize(200, 100)); diff --git a/autotests/integration/xwayland_input_test.cpp b/autotests/integration/xwayland_input_test.cpp --- a/autotests/integration/xwayland_input_test.cpp +++ b/autotests/integration/xwayland_input_test.cpp @@ -26,7 +26,6 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" -#include "xdgshellclient.h" #include @@ -52,7 +51,6 @@ void XWaylandInputTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/autotests/integration/xwayland_selections_test.cpp b/autotests/integration/xwayland_selections_test.cpp --- a/autotests/integration/xwayland_selections_test.cpp +++ b/autotests/integration/xwayland_selections_test.cpp @@ -19,8 +19,8 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "abstract_client.h" #include "platform.h" -#include "xdgshellclient.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" @@ -52,7 +52,6 @@ void XwaylandSelectionsTest::initTestCase() { QSKIP("Skipped as it fails for unknown reasons on build.kde.org"); - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -30,7 +30,6 @@ #include "scene.h" #include "screens.h" #include "shadow.h" -#include "xdgshellclient.h" #include "unmanaged.h" #include "useractions.h" #include "utils.h" @@ -366,7 +365,7 @@ if (auto *server = waylandServer()) { const auto clients = server->clients(); - for (XdgShellClient *c : clients) { + for (AbstractClient *c : clients) { c->setupCompositing(); c->updateShadow(); } @@ -441,10 +440,10 @@ } if (waylandServer()) { - for (XdgShellClient *c : waylandServer()->clients()) { + for (AbstractClient *c : waylandServer()->clients()) { m_scene->removeToplevel(c); } - for (XdgShellClient *c : waylandServer()->clients()) { + for (AbstractClient *c : waylandServer()->clients()) { c->finishCompositing(); } } @@ -749,7 +748,7 @@ } if (auto *server = waylandServer()) { const auto &clients = server->clients(); - auto test = [](XdgShellClient *c) { + auto test = [](AbstractClient *c) { return c->readyForPainting() && !c->repaints().isEmpty(); }; if (std::any_of(clients.begin(), clients.end(), test)) { diff --git a/debug_console.h b/debug_console.h --- a/debug_console.h +++ b/debug_console.h @@ -39,9 +39,9 @@ namespace KWin { +class AbstractClient; class X11Client; class InternalClient; -class XdgShellClient; class Unmanaged; class DebugConsoleFilter; @@ -73,13 +73,13 @@ void add(int parentRow, QVector &clients, T *client); template void remove(int parentRow, QVector &clients, T *client); - XdgShellClient *shellClient(const QModelIndex &index) const; + AbstractClient *waylandClient(const QModelIndex &index) const; InternalClient *internalClient(const QModelIndex &index) const; X11Client *x11Client(const QModelIndex &index) const; Unmanaged *unmanaged(const QModelIndex &index) const; int topLevelRowCount() const; - QVector m_shellClients; + QVector m_waylandClients; QVector m_internalClients; QVector m_x11Clients; QVector m_unmanageds; diff --git a/debug_console.cpp b/debug_console.cpp --- a/debug_console.cpp +++ b/debug_console.cpp @@ -24,7 +24,6 @@ #include "internal_client.h" #include "main.h" #include "scene.h" -#include "xdgshellclient.h" #include "unmanaged.h" #include "wayland_server.h" #include "workspace.h" @@ -876,17 +875,17 @@ if (waylandServer()) { const auto clients = waylandServer()->clients(); for (auto c : clients) { - m_shellClients.append(c); + m_waylandClients.append(c); } // TODO: that only includes windows getting shown, not those which are only created connect(waylandServer(), &WaylandServer::shellClientAdded, this, - [this] (XdgShellClient *c) { - add(s_waylandClientId -1, m_shellClients, c); + [this] (AbstractClient *c) { + add(s_waylandClientId -1, m_waylandClients, c); } ); connect(waylandServer(), &WaylandServer::shellClientRemoved, this, - [this] (XdgShellClient *c) { - remove(s_waylandClientId -1, m_shellClients, c); + [this] (AbstractClient *c) { + remove(s_waylandClientId -1, m_waylandClients, c); } ); } @@ -976,7 +975,7 @@ case s_x11UnmanagedId: return m_unmanageds.count(); case s_waylandClientId: - return m_shellClients.count(); + return m_waylandClients.count(); case s_workspaceInternalId: return m_internalClients.count(); default: @@ -993,7 +992,7 @@ } else if (parent.internalId() < s_idDistance * (s_x11UnmanagedId + 1)) { return propertyCount(parent, &DebugConsoleModel::unmanaged); } else if (parent.internalId() < s_idDistance * (s_waylandClientId + 1)) { - return propertyCount(parent, &DebugConsoleModel::shellClient); + return propertyCount(parent, &DebugConsoleModel::waylandClient); } else if (parent.internalId() < s_idDistance * (s_workspaceInternalId + 1)) { return propertyCount(parent, &DebugConsoleModel::internalClient); } @@ -1045,7 +1044,7 @@ case s_x11UnmanagedId: return indexForClient(row, column, m_unmanageds, s_x11UnmanagedId); case s_waylandClientId: - return indexForClient(row, column, m_shellClients, s_waylandClientId); + return indexForClient(row, column, m_waylandClients, s_waylandClientId); case s_workspaceInternalId: return indexForClient(row, column, m_internalClients, s_workspaceInternalId); default: @@ -1058,7 +1057,7 @@ } else if (parent.internalId() < s_idDistance * (s_x11UnmanagedId + 1)) { return indexForProperty(row, column, parent, &DebugConsoleModel::unmanaged); } else if (parent.internalId() < s_idDistance * (s_waylandClientId + 1)) { - return indexForProperty(row, column, parent, &DebugConsoleModel::shellClient); + return indexForProperty(row, column, parent, &DebugConsoleModel::waylandClient); } else if (parent.internalId() < s_idDistance * (s_workspaceInternalId + 1)) { return indexForProperty(row, column, parent, &DebugConsoleModel::internalClient); } @@ -1195,7 +1194,7 @@ if (index.column() >= 2 || role != Qt::DisplayRole) { return QVariant(); } - if (XdgShellClient *c = shellClient(index)) { + if (AbstractClient *c = waylandClient(index)) { return propertyData(c, index, role); } else if (InternalClient *c = internalClient(index)) { return propertyData(c, index, role); @@ -1222,7 +1221,7 @@ break; } case s_waylandClientId: - return clientData(index, role, m_shellClients); + return clientData(index, role, m_waylandClients); case s_workspaceInternalId: return clientData(index, role, m_internalClients); default: @@ -1243,9 +1242,9 @@ return clients.at(row); } -XdgShellClient *DebugConsoleModel::shellClient(const QModelIndex &index) const +AbstractClient *DebugConsoleModel::waylandClient(const QModelIndex &index) const { - return clientForIndex(index, m_shellClients, s_waylandClientId); + return clientForIndex(index, m_waylandClients, s_waylandClientId); } InternalClient *DebugConsoleModel::internalClient(const QModelIndex &index) const @@ -1295,7 +1294,7 @@ } if (waylandServer()) { connect(waylandServer(), &WaylandServer::shellClientAdded, this, - [this, reset] (XdgShellClient *c) { + [this, reset] (AbstractClient *c) { connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset); reset(); } diff --git a/effects.h b/effects.h --- a/effects.h +++ b/effects.h @@ -296,7 +296,7 @@ protected Q_SLOTS: void slotClientShown(KWin::Toplevel*); - void slotXdgShellClientShown(KWin::Toplevel*); + void slotWaylandClientShown(KWin::Toplevel*); void slotUnmanagedShown(KWin::Toplevel*); void slotWindowClosed(KWin::Toplevel *c, KWin::Deleted *d); void slotClientMaximized(KWin::AbstractClient *c, MaximizeMode maxMode); diff --git a/effects.cpp b/effects.cpp --- a/effects.cpp +++ b/effects.cpp @@ -258,20 +258,18 @@ setupAbstractClientConnections(client); } if (auto w = waylandServer()) { - connect(w, &WaylandServer::shellClientAdded, this, - [this](XdgShellClient *c) { - if (c->readyForPainting()) - slotXdgShellClientShown(c); - else - connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotXdgShellClientShown); - } - ); + connect(w, &WaylandServer::shellClientAdded, this, [this](AbstractClient *c) { + if (c->readyForPainting()) + slotWaylandClientShown(c); + else + connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotWaylandClientShown); + }); const auto clients = waylandServer()->clients(); - for (XdgShellClient *c : clients) { + for (AbstractClient *c : clients) { if (c->readyForPainting()) { setupAbstractClientConnections(c); } else { - connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotXdgShellClientShown); + connect(c, &Toplevel::windowShown, this, &EffectsHandlerImpl::slotWaylandClientShown); } } } @@ -578,11 +576,11 @@ emit windowAdded(c->effectWindow()); } -void EffectsHandlerImpl::slotXdgShellClientShown(Toplevel *t) +void EffectsHandlerImpl::slotWaylandClientShown(Toplevel *toplevel) { - XdgShellClient *c = static_cast(t); - setupAbstractClientConnections(c); - emit windowAdded(t->effectWindow()); + AbstractClient *client = static_cast(toplevel); + setupAbstractClientConnections(client); + emit windowAdded(toplevel->effectWindow()); } void EffectsHandlerImpl::slotUnmanagedShown(KWin::Toplevel *t) @@ -1090,7 +1088,7 @@ if (Unmanaged* w = Workspace::self()->findUnmanaged(id)) return w->effectWindow(); if (waylandServer()) { - if (XdgShellClient *w = waylandServer()->findClient(id)) { + if (AbstractClient *w = waylandServer()->findClient(id)) { return w->effectWindow(); } } @@ -1100,7 +1098,7 @@ EffectWindow* EffectsHandlerImpl::findWindow(KWayland::Server::SurfaceInterface *surf) const { if (waylandServer()) { - if (XdgShellClient *w = waylandServer()->findClient(surf)) { + if (AbstractClient *w = waylandServer()->findClient(surf)) { return w->effectWindow(); } } diff --git a/idle_inhibition.h b/idle_inhibition.h --- a/idle_inhibition.h +++ b/idle_inhibition.h @@ -37,16 +37,15 @@ namespace KWin { class AbstractClient; -class XdgShellClient; class IdleInhibition : public QObject { Q_OBJECT public: explicit IdleInhibition(IdleInterface *idle); ~IdleInhibition() override; - void registerXdgShellClient(XdgShellClient *client); + void registerClient(AbstractClient *client); bool isInhibited() const { return !m_idleInhibitors.isEmpty(); diff --git a/idle_inhibition.cpp b/idle_inhibition.cpp --- a/idle_inhibition.cpp +++ b/idle_inhibition.cpp @@ -19,8 +19,8 @@ along with this program. If not, see . *********************************************************************/ #include "idle_inhibition.h" +#include "abstract_client.h" #include "deleted.h" -#include "xdgshellclient.h" #include "workspace.h" #include @@ -44,19 +44,19 @@ IdleInhibition::~IdleInhibition() = default; -void IdleInhibition::registerXdgShellClient(XdgShellClient *client) +void IdleInhibition::registerClient(AbstractClient *client) { auto updateInhibit = [this, client] { update(client); }; m_connections[client] = connect(client->surface(), &SurfaceInterface::inhibitsIdleChanged, this, updateInhibit); - connect(client, &XdgShellClient::desktopChanged, this, updateInhibit); - connect(client, &XdgShellClient::clientMinimized, this, updateInhibit); - connect(client, &XdgShellClient::clientUnminimized, this, updateInhibit); - connect(client, &XdgShellClient::windowHidden, this, updateInhibit); - connect(client, &XdgShellClient::windowShown, this, updateInhibit); - connect(client, &XdgShellClient::windowClosed, this, + connect(client, &AbstractClient::desktopChanged, this, updateInhibit); + connect(client, &AbstractClient::clientMinimized, this, updateInhibit); + connect(client, &AbstractClient::clientUnminimized, this, updateInhibit); + connect(client, &AbstractClient::windowHidden, this, updateInhibit); + connect(client, &AbstractClient::windowShown, this, updateInhibit); + connect(client, &AbstractClient::windowClosed, this, [this, client] { uninhibit(client); auto it = m_connections.find(client); diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -44,7 +44,6 @@ #include "libinput/device.h" #include "platform.h" #include "popup_input_filter.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "xwl/xwayland_interface.h" #include "internal_client.h" diff --git a/layers.cpp b/layers.cpp --- a/layers.cpp +++ b/layers.cpp @@ -93,7 +93,6 @@ #include "effects.h" #include "composite.h" #include "screenedge.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include "internal_client.h" diff --git a/plugins/platforms/drm/egl_stream_backend.h b/plugins/platforms/drm/egl_stream_backend.h --- a/plugins/platforms/drm/egl_stream_backend.h +++ b/plugins/platforms/drm/egl_stream_backend.h @@ -30,7 +30,6 @@ class DrmBackend; class DrmOutput; class DrmBuffer; -class XdgShellClient; /** * @brief OpenGL Backend using Egl with an EGLDevice. diff --git a/pointer_input.cpp b/pointer_input.cpp --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -27,7 +27,6 @@ #include "input_event_spy.h" #include "osd.h" #include "screens.h" -#include "xdgshellclient.h" #include "wayland_cursor_theme.h" #include "wayland_server.h" #include "workspace.h" diff --git a/popup_input_filter.h b/popup_input_filter.h --- a/popup_input_filter.h +++ b/popup_input_filter.h @@ -29,7 +29,6 @@ namespace KWin { class Toplevel; -class XdgShellClient; class PopupInputFilter : public QObject, public InputEventFilter { diff --git a/popup_input_filter.cpp b/popup_input_filter.cpp --- a/popup_input_filter.cpp +++ b/popup_input_filter.cpp @@ -19,8 +19,8 @@ * */ #include "popup_input_filter.h" +#include "abstract_client.h" #include "deleted.h" -#include "xdgshellclient.h" #include "wayland_server.h" #include diff --git a/scripting/scripting_model.cpp b/scripting/scripting_model.cpp --- a/scripting/scripting_model.cpp +++ b/scripting/scripting_model.cpp @@ -25,7 +25,6 @@ #include "x11client.h" #include "screens.h" #include "workspace.h" -#include "xdgshellclient.h" #include "wayland_server.h" namespace KWin { diff --git a/thumbnailitem.cpp b/thumbnailitem.cpp --- a/thumbnailitem.cpp +++ b/thumbnailitem.cpp @@ -24,7 +24,6 @@ #include "composite.h" #include "effects.h" #include "workspace.h" -#include "xdgshellclient.h" #include "wayland_server.h" // Qt #include diff --git a/useractions.cpp b/useractions.cpp --- a/useractions.cpp +++ b/useractions.cpp @@ -43,7 +43,6 @@ #include "effects.h" #include "platform.h" #include "screens.h" -#include "xdgshellclient.h" #include "virtualdesktops.h" #include "scripting/scripting.h" diff --git a/virtualkeyboard.cpp b/virtualkeyboard.cpp --- a/virtualkeyboard.cpp +++ b/virtualkeyboard.cpp @@ -26,7 +26,6 @@ #include "wayland_server.h" #include "workspace.h" #include "xkb.h" -#include "xdgshellclient.h" #include "screenlockerwatcher.h" #include @@ -156,7 +155,7 @@ } ); - auto newClient = waylandServer()->findAbstractClient(waylandServer()->seat()->focusedTextInputSurface()); + auto newClient = waylandServer()->findClient(waylandServer()->seat()->focusedTextInputSurface()); // Reset the old client virtual keybaord geom if necessary // Old and new clients could be the same if focus moves between subsurfaces if (newClient != m_trackedClient) { @@ -166,7 +165,7 @@ m_trackedClient = newClient; } - m_trackedClient = waylandServer()->findAbstractClient(waylandServer()->seat()->focusedTextInputSurface()); + m_trackedClient = waylandServer()->findClient(waylandServer()->seat()->focusedTextInputSurface()); updateInputPanelState(); } else { diff --git a/wayland_server.h b/wayland_server.h --- a/wayland_server.h +++ b/wayland_server.h @@ -122,13 +122,13 @@ } KWayland::Server::LinuxDmabufUnstableV1Interface *linuxDmabuf(); - QList clients() const { + QList clients() const { return m_clients; } - void removeClient(XdgShellClient *c); - XdgShellClient *findClient(quint32 id) const; - XdgShellClient *findClient(KWayland::Server::SurfaceInterface *surface) const; - AbstractClient *findAbstractClient(KWayland::Server::SurfaceInterface *surface) const; + void removeClient(AbstractClient *c); + AbstractClient *findClient(quint32 id) const; + AbstractClient *findClient(KWayland::Server::SurfaceInterface *surface) const; + XdgShellClient *findXdgShellClient(KWayland::Server::SurfaceInterface *surface) const; /** * @returns a transient parent of a surface imported with the foreign protocol, if any @@ -230,8 +230,8 @@ } Q_SIGNALS: - void shellClientAdded(KWin::XdgShellClient *); - void shellClientRemoved(KWin::XdgShellClient *); + void shellClientAdded(KWin::AbstractClient *); + void shellClientRemoved(KWin::AbstractClient *); void terminatingInternalClientConnection(); void initialized(); void foreignTransientChanged(KWayland::Server::SurfaceInterface *child); @@ -281,7 +281,7 @@ } m_internalConnection; KWayland::Server::XdgForeignInterface *m_XdgForeign = nullptr; KWayland::Server::KeyStateInterface *m_keyState = nullptr; - QList m_clients; + QList m_clients; QHash m_clientIds; InitalizationFlags m_initFlags; QVector m_plasmaShellSurfaces; diff --git a/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -328,7 +328,7 @@ m_xdgDecorationManager = m_display->createXdgDecorationManager(m_xdgShell, m_display); m_xdgDecorationManager->create(); connect(m_xdgDecorationManager, &XdgDecorationManagerInterface::xdgDecorationInterfaceCreated, this, [this] (XdgDecorationInterface *deco) { - if (XdgShellClient *client = findClient(deco->surface()->surface())) { + if (XdgShellClient *client = findXdgShellClient(deco->surface()->surface())) { client->installXdgDecoration(deco); } }); @@ -343,13 +343,13 @@ m_idle = m_display->createIdle(m_display); m_idle->create(); auto idleInhibition = new IdleInhibition(m_idle); - connect(this, &WaylandServer::shellClientAdded, idleInhibition, &IdleInhibition::registerXdgShellClient); + connect(this, &WaylandServer::shellClientAdded, idleInhibition, &IdleInhibition::registerClient); m_display->createIdleInhibitManager(IdleInhibitManagerInterfaceVersion::UnstableV1, m_display)->create(); m_plasmaShell = m_display->createPlasmaShell(m_display); m_plasmaShell->create(); connect(m_plasmaShell, &PlasmaShellInterface::surfaceCreated, [this] (PlasmaShellSurfaceInterface *surface) { - if (XdgShellClient *client = findClient(surface->surface())) { + if (XdgShellClient *client = findXdgShellClient(surface->surface())) { client->installPlasmaShellSurface(surface); } else { m_plasmaShellSurfaces << surface; @@ -365,16 +365,16 @@ m_appMenuManager->create(); connect(m_appMenuManager, &AppMenuManagerInterface::appMenuCreated, [this] (AppMenuInterface *appMenu) { - if (XdgShellClient *client = findClient(appMenu->surface())) { + if (XdgShellClient *client = findXdgShellClient(appMenu->surface())) { client->installAppMenu(appMenu); } } ); m_paletteManager = m_display->createServerSideDecorationPaletteManager(m_display); m_paletteManager->create(); connect(m_paletteManager, &ServerSideDecorationPaletteManagerInterface::paletteCreated, [this] (ServerSideDecorationPaletteInterface *palette) { - if (XdgShellClient *client = findClient(palette->surface())) { + if (XdgShellClient *client = findXdgShellClient(palette->surface())) { client->installPalette(palette); } } @@ -420,7 +420,7 @@ m_decorationManager = m_display->createServerSideDecorationManager(m_display); connect(m_decorationManager, &ServerSideDecorationManagerInterface::decorationCreated, this, [this] (ServerSideDecorationInterface *deco) { - if (XdgShellClient *c = findClient(deco->surface())) { + if (XdgShellClient *c = findXdgShellClient(deco->surface())) { c->installServerSideDecoration(deco); } connect(deco, &ServerSideDecorationInterface::modeRequested, this, @@ -639,7 +639,7 @@ m_internalConnection.client->initConnection(); } -void WaylandServer::removeClient(XdgShellClient *c) +void WaylandServer::removeClient(AbstractClient *c) { m_clients.removeAll(c); emit shellClientRemoved(c); @@ -656,10 +656,10 @@ m_display->dispatchEvents(0); } -static XdgShellClient *findClientInList(const QList &clients, quint32 id) +static AbstractClient *findClientInList(const QList &clients, quint32 id) { auto it = std::find_if(clients.begin(), clients.end(), - [id] (XdgShellClient *c) { + [id] (AbstractClient *c) { return c->windowId() == id; } ); @@ -669,10 +669,10 @@ return *it; } -static XdgShellClient *findClientInList(const QList &clients, KWayland::Server::SurfaceInterface *surface) +static AbstractClient *findClientInList(const QList &clients, KWayland::Server::SurfaceInterface *surface) { auto it = std::find_if(clients.begin(), clients.end(), - [surface] (XdgShellClient *c) { + [surface] (AbstractClient *c) { return c->surface() == surface; } ); @@ -682,31 +682,31 @@ return *it; } -XdgShellClient *WaylandServer::findClient(quint32 id) const +AbstractClient *WaylandServer::findClient(quint32 id) const { if (id == 0) { return nullptr; } - if (XdgShellClient *c = findClientInList(m_clients, id)) { + if (AbstractClient *c = findClientInList(m_clients, id)) { return c; } return nullptr; } -XdgShellClient *WaylandServer::findClient(SurfaceInterface *surface) const +AbstractClient *WaylandServer::findClient(SurfaceInterface *surface) const { if (!surface) { return nullptr; } - if (XdgShellClient *c = findClientInList(m_clients, surface)) { + if (AbstractClient *c = findClientInList(m_clients, surface)) { return c; } return nullptr; } -AbstractClient *WaylandServer::findAbstractClient(SurfaceInterface *surface) const +XdgShellClient *WaylandServer::findXdgShellClient(SurfaceInterface *surface) const { - return findClient(surface); + return qobject_cast(findClient(surface)); } quint32 WaylandServer::createWindowId(SurfaceInterface *surface) diff --git a/workspace.h b/workspace.h --- a/workspace.h +++ b/workspace.h @@ -565,6 +565,9 @@ Unmanaged* createUnmanaged(xcb_window_t w); void addUnmanaged(Unmanaged* c); + void addShellClient(AbstractClient *client); + void removeShellClient(AbstractClient *client); + //--------------------------------------------------------------------- void closeActivePopup(); diff --git a/workspace.cpp b/workspace.cpp --- a/workspace.cpp +++ b/workspace.cpp @@ -288,95 +288,9 @@ Scripting::create(this); - if (auto w = waylandServer()) { - connect(w, &WaylandServer::shellClientAdded, this, - [this] (XdgShellClient *c) { - setupClientConnections(c); - c->updateDecoration(false); - updateClientLayer(c); - if (!c->isInternal()) { - const QRect area = clientArea(PlacementArea, Screens::self()->current(), c->desktop()); - bool placementDone = false; - if (c->isInitialPositionSet()) { - placementDone = true; - } - if (c->isFullScreen()) { - placementDone = true; - } - if (c->maximizeMode() == MaximizeMode::MaximizeFull) { - placementDone = true; - } - if (c->rules()->checkPosition(invalidPoint, true) != invalidPoint) { - placementDone = true; - } - if (!placementDone) { - c->placeIn(area); - } - m_allClients.append(c); - if (!unconstrained_stacking_order.contains(c)) - unconstrained_stacking_order.append(c); // Raise if it hasn't got any stacking position yet - if (!stacking_order.contains(c)) // It'll be updated later, and updateToolWindows() requires - stacking_order.append(c); // c to be in stacking_order - } - markXStackingOrderAsDirty(); - updateStackingOrder(true); - updateClientArea(); - if (c->wantsInput() && !c->isMinimized()) { - activateClient(c); - } - updateTabbox(); - connect(c, &XdgShellClient::windowShown, this, - [this, c] { - updateClientLayer(c); - // TODO: when else should we send the client through placement? - if (c->hasTransientPlacementHint()) { - const QRect area = clientArea(PlacementArea, Screens::self()->current(), c->desktop()); - c->placeIn(area); - } - markXStackingOrderAsDirty(); - updateStackingOrder(true); - updateClientArea(); - if (c->wantsInput()) { - activateClient(c); - } - } - ); - connect(c, &XdgShellClient::windowHidden, this, - [this] { - // TODO: update tabbox if it's displayed - markXStackingOrderAsDirty(); - updateStackingOrder(true); - updateClientArea(); - } - ); - } - ); - connect(w, &WaylandServer::shellClientRemoved, this, - [this] (XdgShellClient *c) { - m_allClients.removeAll(c); - if (c == most_recently_raised) { - most_recently_raised = nullptr; - } - if (c == delayfocus_client) { - cancelDelayFocus(); - } - if (c == last_active_client) { - last_active_client = nullptr; - } - if (client_keys_client == c) { - setupWindowShortcutDone(false); - } - if (!c->shortcut().isEmpty()) { - c->setShortcut(QString()); // Remove from client_keys - } - clientHidden(c); - emit clientRemoved(c); - markXStackingOrderAsDirty(); - updateStackingOrder(true); - updateClientArea(); - updateTabbox(); - } - ); + if (auto server = waylandServer()) { + connect(server, &WaylandServer::shellClientAdded, this, &Workspace::addShellClient); + connect(server, &WaylandServer::shellClientRemoved, this, &Workspace::removeShellClient); } // SELI TODO: This won't work with unreasonable focus policies, @@ -559,9 +473,12 @@ X11Client::cleanupX11(); if (waylandServer()) { - const QList shellClients = waylandServer()->clients(); - for (XdgShellClient *shellClient : shellClients) { - shellClient->destroyClient(); + // TODO: Introduce AbstractClient::destroy(). + const QList shellClients = waylandServer()->clients(); + for (AbstractClient *client : shellClients) { + if (XdgShellClient *shellClient = qobject_cast(client)) { + shellClient->destroyClient(); + } } } @@ -773,6 +690,92 @@ } } +void Workspace::addShellClient(AbstractClient *client) +{ + setupClientConnections(client); + client->updateDecoration(false); + updateClientLayer(client); + + const QRect area = clientArea(PlacementArea, Screens::self()->current(), client->desktop()); + bool placementDone = false; + if (client->isInitialPositionSet()) { + placementDone = true; + } + if (client->isFullScreen()) { + placementDone = true; + } + if (client->maximizeMode() == MaximizeMode::MaximizeFull) { + placementDone = true; + } + if (client->rules()->checkPosition(invalidPoint, true) != invalidPoint) { + placementDone = true; + } + if (!placementDone) { + client->placeIn(area); + } + m_allClients.append(client); + if (!unconstrained_stacking_order.contains(client)) { + unconstrained_stacking_order.append(client); // Raise if it hasn't got any stacking position yet + } + if (!stacking_order.contains(client)) { // It'll be updated later, and updateToolWindows() requires + stacking_order.append(client); // client to be in stacking_order + } + + markXStackingOrderAsDirty(); + updateStackingOrder(true); + updateClientArea(); + if (client->wantsInput() && !client->isMinimized()) { + activateClient(client); + } + updateTabbox(); + connect(client, &AbstractClient::windowShown, this, [this, client] { + updateClientLayer(client); + // TODO: when else should we send the client through placement? + if (client->hasTransientPlacementHint()) { + const QRect area = clientArea(PlacementArea, Screens::self()->current(), client->desktop()); + client->placeIn(area); + } + markXStackingOrderAsDirty(); + updateStackingOrder(true); + updateClientArea(); + if (client->wantsInput()) { + activateClient(client); + } + }); + connect(client, &AbstractClient::windowHidden, this, [this] { + // TODO: update tabbox if it's displayed + markXStackingOrderAsDirty(); + updateStackingOrder(true); + updateClientArea(); + }); +} + +void Workspace::removeShellClient(AbstractClient *client) +{ + m_allClients.removeAll(client); + if (client == most_recently_raised) { + most_recently_raised = nullptr; + } + if (client == delayfocus_client) { + cancelDelayFocus(); + } + if (client == last_active_client) { + last_active_client = nullptr; + } + if (client_keys_client == client) { + setupWindowShortcutDone(false); + } + if (!client->shortcut().isEmpty()) { + client->setShortcut(QString()); // Remove from client_keys + } + clientHidden(client); + emit clientRemoved(client); + markXStackingOrderAsDirty(); + updateStackingOrder(true); + updateClientArea(); + updateTabbox(); +} + void Workspace::updateToolWindows(bool also_hide) { // TODO: What if Client's transiency/group changes? should this be called too? (I'm paranoid, am I not?) @@ -2074,7 +2077,7 @@ } } if (waylandServer()) { - auto updateStrutsForWaylandClient = [&] (XdgShellClient *c) { + auto updateStrutsForWaylandClient = [&] (AbstractClient *c) { // assuming that only docks have "struts" and that all docks have a strut if (!c->hasStrut()) { return; diff --git a/xdgshellclient.h b/xdgshellclient.h --- a/xdgshellclient.h +++ b/xdgshellclient.h @@ -128,8 +128,6 @@ void installPalette(KWayland::Server::ServerSideDecorationPaletteInterface *palette); void installXdgDecoration(KWayland::Server::XdgDecorationInterface *decoration); - void placeIn(const QRect &area); - protected: void addDamage(const QRegion &damage) override; bool belongsToSameApplication(const AbstractClient *other, SameApplicationChecks checks) const override; diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -373,7 +373,7 @@ const auto clients = waylandServer()->clients(); return std::any_of(clients.constBegin(), clients.constEnd(), - [this](const XdgShellClient *client) { + [this](const AbstractClient *client) { if (belongsToSameApplication(client, SameApplicationChecks())) { return client->isDesktop(); } @@ -1180,7 +1180,7 @@ if (!transientSurface) { transientSurface = waylandServer()->findForeignTransientForSurface(surface()); } - XdgShellClient *transientClient = waylandServer()->findClient(transientSurface); + AbstractClient *transientClient = waylandServer()->findClient(transientSurface); if (transientClient != transientFor()) { // Remove from main client. if (transientFor()) { @@ -1934,12 +1934,6 @@ workspace()->updateMinimizedOfTransients(this); } -void XdgShellClient::placeIn(const QRect &area) -{ - Placement::self()->place(this, area); - setGeometryRestore(frameGeometry()); -} - void XdgShellClient::showOnScreenEdge() { if (!m_plasmaShellSurface || m_unmapped) {