Commit be759b7d authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Use AbstractClient instead of XdgShellClient wherever possible

Summary:
Currently, we have only one shell client type - XdgShellClient. We use
it when we are dealing with Wayland clients. But it isn't really a good
idea because we may need to support shell surfaces other than xdg-shell
ones, for example input panel surfaces.

In order to make kwin more extensible, this change replaces all usages
of the XdgShellClient class with the AbstractClient class.

Test Plan: Existing tests pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27778
parent b5392802
......@@ -252,6 +252,14 @@ void AbstractClient::updateLayer()
(*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 AbstractClient::iconGeometry() const
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;
}
......
......@@ -440,6 +440,7 @@ public:
*/
virtual bool hasTransient(const AbstractClient* c, bool indirect) const;
const QList<AbstractClient*>& transients() const; // Is not indirect
virtual void addTransient(AbstractClient *client);
virtual void removeTransient(AbstractClient* cl);
virtual QList<AbstractClient*> mainClients() const; // Call once before loop , is not indirect
QList<AbstractClient*> allMainClients() const; // Call once before loop , is indirect
......@@ -613,6 +614,8 @@ public:
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 @@ protected:
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.
*/
......
......@@ -20,12 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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 <KWayland/Client/surface.h>
......@@ -58,7 +58,6 @@ private:
void ActivationTest::initTestCase()
{
qRegisterMetaType<AbstractClient *>();
qRegisterMetaType<XdgShellClient *>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
......@@ -101,13 +100,13 @@ void ActivationTest::testSwitchToWindowToLeft()
// Create several clients on the left screen.
QScopedPointer<Surface> surface1(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> 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 @@ void ActivationTest::testSwitchToWindowToLeft()
// Create several clients on the right screen.
QScopedPointer<Surface> surface3(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface4(Test::createSurface());
QScopedPointer<XdgShellSurface> 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 @@ void ActivationTest::testSwitchToWindowToRight()
// Create several clients on the left screen.
QScopedPointer<Surface> surface1(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> 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 @@ void ActivationTest::testSwitchToWindowToRight()
// Create several clients on the right screen.
QScopedPointer<Surface> surface3(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface4(Test::createSurface());
QScopedPointer<XdgShellSurface> 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 @@ void ActivationTest::testSwitchToWindowAbove()
// Create several clients on the top screen.
QScopedPointer<Surface> surface1(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> 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 @@ void ActivationTest::testSwitchToWindowAbove()
// Create several clients on the bottom screen.
QScopedPointer<Surface> surface3(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface4(Test::createSurface());
QScopedPointer<XdgShellSurface> 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 @@ void ActivationTest::testSwitchToWindowBelow()
// Create several clients on the top screen.
QScopedPointer<Surface> surface1(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> 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 @@ void ActivationTest::testSwitchToWindowBelow()
// Create several clients on the bottom screen.
QScopedPointer<Surface> surface3(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface4(Test::createSurface());
QScopedPointer<XdgShellSurface> 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,14 +373,14 @@ void ActivationTest::testSwitchToWindowMaximized()
// Create several maximized clients on the left screen.
QScopedPointer<Surface> surface1(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<quint32>());
Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red);
......@@ -389,14 +388,14 @@ void ActivationTest::testSwitchToWindowMaximized()
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<quint32>());
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
......@@ -410,13 +409,13 @@ void ActivationTest::testSwitchToWindowMaximized()
// Create several clients on the right screen.
QScopedPointer<Surface> surface3(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface4(Test::createSurface());
QScopedPointer<XdgShellSurface> 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,14 +458,14 @@ void ActivationTest::testSwitchToWindowFullScreen()
// Create several maximized clients on the top screen.
QScopedPointer<Surface> surface1(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<quint32>());
Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red);
......@@ -474,14 +473,14 @@ void ActivationTest::testSwitchToWindowFullScreen()
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<quint32>());
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
......@@ -495,13 +494,13 @@ void ActivationTest::testSwitchToWindowFullScreen()
// Create several clients on the bottom screen.
QScopedPointer<Surface> surface3(Test::createSurface());
QScopedPointer<XdgShellSurface> 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<Surface> surface4(Test::createSurface());
QScopedPointer<XdgShellSurface> 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());
......
......@@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "screens.h"
#include "wayland_server.h"
#include "workspace.h"
#include "xdgshellclient.h"
#include "xcbutils.h"
#include <kwineffects.h>
......@@ -58,7 +57,6 @@ private:
void ActivitiesTest::initTestCase()
{
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
qRegisterMetaType<KWin::Deleted*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......
......@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "generic_scene_opengl_test.h"
#include "abstract_client.h"
#include "composite.h"
#include "xdgshellclient.h"
#include "wayland_server.h"
#include <KWayland/Client/xdgshell.h>
......@@ -61,7 +61,7 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
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 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
// 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 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
// 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 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
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);
......
......@@ -21,13 +21,13 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#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 @@ private Q_SLOTS:
void TestDbusInterface::initTestCase()
{
qRegisterMetaType<KWin::Deleted*>();
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......@@ -135,7 +134,7 @@ void TestDbusInterface::testGetWindowInfoXdgShellClient()
Test::render(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(clientAddedSpy.isEmpty());
QVERIFY(clientAddedSpy.wait());
auto client = clientAddedSpy.first().first().value<XdgShellClient *>();
auto client = clientAddedSpy.first().first().value<AbstractClient *>();
QVERIFY(client);
// let's get the window info
......@@ -226,7 +225,7 @@ void TestDbusInterface::testGetWindowInfoXdgShellClient()
// 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();
......
......@@ -18,11 +18,11 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#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 @@ void DebugConsoleTest::initTestCase()
{
qRegisterMetaType<KWin::AbstractClient *>();
qRegisterMetaType<KWin::InternalClient *>();
qRegisterMetaType<KWin::XdgShellClient *>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
......
......@@ -26,7 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "touch_input.h"
#include "screenedge.h"
#include "screens.h"
#include "xdgshellclient.h"
#include "wayland_server.h"
#include "workspace.h"
#include <kwineffects.h>
......@@ -135,7 +134,6 @@ void DecorationInputTest::initTestCase()
{
qRegisterMetaType<KWin::AbstractClient *>();
qRegisterMetaType<KWin::InternalClient *>();
qRegisterMetaType<KWin::XdgShellClient *>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
......
......@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "kwin_wayland_test.h"
#include "abstract_client.h"
#include "platform.h"
#include "x11client.h"
#include "cursor.h"
......@@ -26,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "screens.h"
#include "wayland_server.h"
#include "workspace.h"
#include "xdgshellclient.h"
#include "xcbutils.h"
#include <kwineffects.h>
......@@ -52,7 +52,6 @@ private:
void X11DesktopWindowTest::initTestCase()
{
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
qRegisterMetaType<KWin::Deleted*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......
......@@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "wayland_server.h"
#include "workspace.h"
#include "scene.h"
#include "xdgshellclient.h"
#include <kwineffects.h>
#include <KDecoration2/Decoration>
......@@ -54,7 +53,6 @@ private Q_SLOTS:
void DontCrashAuroraeDestroyDecoTest::initTestCase()
{
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
......
......@@ -26,7 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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 @@ private Q_SLOTS:
void DontCrashCancelAnimationFromAnimationEndedTest::initTestCase()
{
qRegisterMetaType<KWin::Deleted*>();
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit()));
......
......@@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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::cleanup()
void DontCrashCursorPhysicalSizeEmpty::initTestCase()
{
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
......
......@@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "screens.h"
#include "wayland_server.h"
#include "workspace.h"
#include "xdgshellclient.h"
#include <kwineffects.h>
#include <KDecoration2/Decoration>
......@@ -50,7 +49,6 @@ private Q_SLOTS:
void DontCrashEmptyDecorationTest::initTestCase()
{
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
......
......@@ -28,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "screens.h"
#include "wayland_server.h"
#include "workspace.h"
#include "xdgshellclient.h"
#include <kwineffects.h>
#include <KWayland/Client/server_decoration.h>
......@@ -56,7 +55,6 @@ private Q_SLOTS:
void DontCrashNoBorder::initTestCase()
{
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
......
......@@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "effects.h"
#include "platform.h"
#include "screens.h"
#include "xdgshellclient.h"
#include "wayland_server.h"
#include "workspace.h"
......@@ -60,7 +59,6 @@ void DontCrashReinitializeCompositorTest::initTestCase()
qRegisterMetaType<KWin::AbstractClient *>();
qRegisterMetaType<KWin::Deleted *>();
qRegisterMetaType<KWin::XdgShellClient *>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
......@@ -134,7 +132,7 @@ void DontCrashReinitializeCompositorTest::testReinitializeCompositor()
QVERIFY(!surface.isNull());
QScopedPointer<XdgShellSurface> 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);