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.
*/
......
This diff is collapsed.
......@@ -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);
QVERIFY(client);
// Make sure that only the test effect is loaded.
......@@ -147,7 +145,7 @@ void DontCrashReinitializeCompositorTest::testReinitializeCompositor()
QVERIFY(!effect->isActive());
// Close the test client.
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 "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 @@ private Q_SLOTS:
void TestDontCrashUseractionsMenu::initTestCase()
{
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 "platform.h"
#include "scene.h"
#include "xdgshellclient.h"
#include "wayland_server.h"
#include "workspace.h"
......@@ -57,7 +56,6 @@ void DesktopSwitchingAnimationTest::initTestCase()
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::AbstractClient *>();
qRegisterMetaType<KWin::XdgShellClient *>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
......@@ -128,7 +126,7 @@ void DesktopSwitchingAnimationTest::testSwitchDesktops()
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);
QVERIFY(client);
QCOMPARE(client->desktops().count(), 1);
QCOMPARE(client->desktops().first(), VirtualDesktopManager::self()->desktops().first());
......
......@@ -18,12 +18,12 @@ 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 "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 @@ private:
void FadeTest::initTestCase()
{
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
qRegisterMetaType<KWin::Effect*>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
......
......@@ -26,7 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "effects.h"
#include "platform.h"
#include "scene.h"
#include "xdgshellclient.h"
#include "wayland_server.h"
#include "workspace.h"
......@@ -57,7 +56,6 @@ void MaximizeAnimationTest::initTestCase()
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::AbstractClient *>();
qRegisterMetaType<KWin::XdgShellClient *>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
......@@ -133,7 +131,7 @@ void MaximizeAnimationTest::testMaximizeRestore()
// Draw contents of the surface.
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
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 @@ void MaximizeAnimationTest::testMaximizeRestore()
QVERIFY(!effect->isActive());
// Maximize the client.
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy maximizeChangedSpy(client, qOverload<AbstractClient *, bool, bool>(&XdgShellClient::clientMaximizedStateChanged));
QSignalSpy maximizeChangedSpy(client, qOverload<AbstractClient *, bool, bool>(&AbstractClient::clientMaximizedStateChanged));
QVERIFY(maximizeChangedSpy.isValid());
workspace()->slotWindowMaximize();
......
......@@ -26,7 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "effects.h"
#include "platform.h"
#include "scene.h"
#include "xdgshellclient.h"
#include "wayland_server.h"
#include "workspace.h"
......@@ -59,7 +58,6 @@ void MinimizeAnimationTest::initTestCase()
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::AbstractClient *>();
qRegisterMetaType<KWin::XdgShellClient *>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
......@@ -134,7 +132,7 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
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 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
QVERIFY(!surface.isNull());
QScopedPointer<XdgShellSurface> 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);
......
......@@ -26,7 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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 @@ void PopupOpenCloseAnimationTest::initTestCase()
qRegisterMetaType<KWin::AbstractClient *>();
qRegisterMetaType<KWin::Deleted *>();
qRegisterMetaType<KWin::InternalClient *>();
qRegisterMetaType<KWin::XdgShellClient *>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
......@@ -119,7 +117,7 @@ void PopupOpenCloseAnimationTest::testAnimatePopups()
QVERIFY(!mainWindowSurface.isNull());
QScopedPointer<XdgShellSurface> 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 @@ void PopupOpenCloseAnimationTest::testAnimatePopups()
positioner.setAnchorEdge(Qt::BottomEdge | Qt::LeftEdge);
QScopedPointer<XdgShellPopup> 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 @@ void PopupOpenCloseAnimationTest::testAnimatePopups()
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 @@ void PopupOpenCloseAnimationTest::testAnimateUserActionsPopup()
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);
QVERIFY(client);
// Load effect that will be tested.
......@@ -234,7 +232,7 @@ void PopupOpenCloseAnimationTest::testAnimateDecorationTooltips()
QScopedPointer<XdgDecoration> 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());
......
......@@ -21,6 +21,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "scripting/scriptedeffect.h"
#include "libkwineffects/anidata_p.h"
#include "abstract_client.h"
#include "composite.h"
#include "cursor.h"
#include "deleted.h"
......@@ -29,7 +30,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#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 @@ bool ScriptedEffectWithDebugSpy::load(const QString &name)
void ScriptedEffectsTest::initTestCase()
{
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
qRegisterMetaType<KWin::Deleted*>();
qRegisterMetaType<KWin::Effect*>();
......@@ -511,7 +510,7 @@ void ScriptedEffectsTest::testGrab()
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 @@ void ScriptedEffectsTest::testGrabAlreadyGrabbedWindow()
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 @@ void ScriptedEffectsTest::testGrabAlreadyGrabbedWindowForced()
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 @@ void ScriptedEffectsTest::testUngrab()
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 @@ void ScriptedEffectsTest::testRedirect()
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 @@ void ScriptedEffectsTest::testComplete()
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);
......
......@@ -26,7 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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 @@ private Q_SLOTS:
void SlidingPopupsTest::initTestCase()
{
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::XdgShellClient *>();
qRegisterMetaType<KWin::AbstractClient*>();
qRegisterMetaType<KWin::Deleted*>();
qRegisterMetaType<KWin::Effect*>();
......
......@@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "effects.h"
#include "platform.h"
#include "scene.h"
#include "xdgshellclient.h"
#include "wayland_server.h"
#include "workspace.h"
......@@ -61,7 +60,6 @@ void ToplevelOpenCloseAnimationTest::initTestCase()
qRegisterMetaType<KWin::AbstractClient *>();
qRegisterMetaType<KWin::Deleted *>();
qRegisterMetaType<KWin::XdgShellClient *>();
QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated);
QVERIFY(workspaceCreatedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
......@@ -137,7 +135,7 @@ void ToplevelOpenCloseAnimationTest::testAnimateToplevels()
QVERIFY(!surface.isNull());
QScopedPointer<XdgShellSurface> shellSurface<