Commit d92d6e77 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii Committed by Vlad Zahorodnii

[autotests] Don't test wl-shell clients

Summary:
This change removes all traces of wl-shell in the test suite. That's a
prerequisite for dropping wl-shell support in KWin.

Given that wl-shell and xdg-shell are not interchangeable, some tests
were removed and initialization sequence in some tests was adjusted.

The most notable change is ensuring that each plasmashell window sets
its role and initial position before committing the surface. Setting
those properties before the first surface commit is important because
our window placement code needs to know window type in order to
avoid maximizing panels, popups, etc.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23561
parent bebe8120
......@@ -19,8 +19,6 @@ function(integrationTest)
endif()
endfunction()
integrationTest(WAYLAND_ONLY NAME testStart SRCS start_test.cpp)
integrationTest(WAYLAND_ONLY NAME testTransientNoInput SRCS transient_no_input_test.cpp)
integrationTest(NAME testDontCrashGlxgears SRCS dont_crash_glxgears.cpp)
integrationTest(NAME testLockScreen SRCS lockscreen.cpp)
integrationTest(WAYLAND_ONLY NAME testDecorationInput SRCS decoration_input_test.cpp)
......
......@@ -32,9 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "wayland_server.h"
#include "workspace.h"
#include <KWayland/Client/shell.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Client/xdgshell.h>
#include <QDBusArgument>
#include <QDBusConnection>
......@@ -116,12 +114,11 @@ void TestDbusInterface::testGetWindowInfoInvalidUuid()
void TestDbusInterface::testGetWindowInfoShellClient_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::addColumn<Test::XdgShellSurfaceType>("type");
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable;
}
void TestDbusInterface::testGetWindowInfoShellClient()
......@@ -130,12 +127,10 @@ void TestDbusInterface::testGetWindowInfoShellClient()
QVERIFY(clientAddedSpy.isValid());
QScopedPointer<Surface> surface(Test::createSurface());
QFETCH(Test::ShellSurfaceType, type);
QScopedPointer<QObject> shellSurface(Test::createShellSurface(type, surface.data()));
if (type != Test::ShellSurfaceType::WlShell) {
qobject_cast<XdgShellSurface*>(shellSurface.data())->setAppId(QByteArrayLiteral("org.kde.foo"));
qobject_cast<XdgShellSurface*>(shellSurface.data())->setTitle(QStringLiteral("Test window"));
}
QFETCH(Test::XdgShellSurfaceType, type);
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellSurface(type, surface.data()));
shellSurface->setAppId(QByteArrayLiteral("org.kde.foo"));
shellSurface->setTitle(QStringLiteral("Test window"));
// now let's render
Test::render(surface.data(), QSize(100, 50), Qt::blue);
......@@ -173,15 +168,9 @@ void TestDbusInterface::testGetWindowInfoShellClient()
QCOMPARE(windowData.value(QStringLiteral("localhost")).toBool(), true);
QCOMPARE(windowData.value(QStringLiteral("role")).toString(), QString());
QCOMPARE(windowData.value(QStringLiteral("resourceName")).toString(), QStringLiteral("testDbusInterface"));
if (type == Test::ShellSurfaceType::WlShell) {
QCOMPARE(windowData.value(QStringLiteral("resourceClass")).toString(), QString());
QCOMPARE(windowData.value(QStringLiteral("desktopFile")).toString(), QString());
QCOMPARE(windowData.value(QStringLiteral("caption")).toString(), QString());
} else {
QCOMPARE(windowData.value(QStringLiteral("resourceClass")).toString(), QStringLiteral("org.kde.foo"));
QCOMPARE(windowData.value(QStringLiteral("desktopFile")).toString(), QStringLiteral("org.kde.foo"));
QCOMPARE(windowData.value(QStringLiteral("caption")).toString(), QStringLiteral("Test window"));
}
QCOMPARE(windowData.value(QStringLiteral("resourceClass")).toString(), QStringLiteral("org.kde.foo"));
QCOMPARE(windowData.value(QStringLiteral("desktopFile")).toString(), QStringLiteral("org.kde.foo"));
QCOMPARE(windowData.value(QStringLiteral("caption")).toString(), QStringLiteral("Test window"));
auto verifyProperty = [client] (const QString &name) {
QDBusPendingReply<QVariantMap> reply{getWindowInfo(client->internalId())};
......
......@@ -29,7 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/compositor.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/shm_pool.h>
#include <KWayland/Client/surface.h>
......@@ -299,10 +298,11 @@ void DebugConsoleTest::testX11Unmanaged()
void DebugConsoleTest::testWaylandClient_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::addColumn<Test::XdgShellSurfaceType>("type");
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable;
}
void DebugConsoleTest::testWaylandClient()
......@@ -331,8 +331,8 @@ void DebugConsoleTest::testWaylandClient()
using namespace KWayland::Client;
QScopedPointer<Surface> surface(Test::createSurface());
QVERIFY(surface->isValid());
QFETCH(Test::ShellSurfaceType, type);
QScopedPointer<QObject> shellSurface(Test::createShellSurface(type, surface.data()));
QFETCH(Test::XdgShellSurfaceType, type);
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellSurface(type, surface.data()));
QVERIFY(!shellSurface.isNull());
Test::render(surface.data(), QSize(10, 10), Qt::red);
......
......@@ -36,7 +36,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/compositor.h>
#include <KWayland/Client/shm_pool.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/surface.h>
namespace KWin
......@@ -99,7 +98,7 @@ void DontCrashCancelAnimationFromAnimationEndedTest::testScript()
// create a window
Surface *surface = Test::createSurface(Test::waylandCompositor());
QVERIFY(surface);
ShellSurface *shellSurface = Test::createShellSurface(surface, surface);
XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface);
QVERIFY(shellSurface);
// let's render
auto c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue);
......
......@@ -33,7 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/seat.h>
#include <KWayland/Client/server_decoration.h>
#include <KWayland/Client/xdgshell.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Server/display.h>
#include <KWayland/Server/output_interface.h>
......@@ -89,12 +88,11 @@ void DontCrashCursorPhysicalSizeEmpty::initTestCase()
void DontCrashCursorPhysicalSizeEmpty::testMoveCursorOverDeco_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::addColumn<Test::XdgShellSurfaceType>("type");
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable;
}
void DontCrashCursorPhysicalSizeEmpty::testMoveCursorOverDeco()
......@@ -103,9 +101,9 @@ void DontCrashCursorPhysicalSizeEmpty::testMoveCursorOverDeco()
// a reason for creation failure could be physical size not existing
// see BUG: 390314
QScopedPointer<Surface> surface(Test::createSurface());
QFETCH(Test::ShellSurfaceType, type);
QFETCH(Test::XdgShellSurfaceType, type);
Test::waylandServerSideDecoration()->create(surface.data(), surface.data());
QScopedPointer<QObject> shellSurface(Test::createShellSurface(type, surface.data()));
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellSurface(type, surface.data()));
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(c);
......
......@@ -32,7 +32,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kwineffects.h>
#include <KWayland/Client/server_decoration.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/surface.h>
#include <KDecoration2/Decoration>
......@@ -100,12 +99,11 @@ void DontCrashNoBorder::cleanup()
void DontCrashNoBorder::testCreateWindow_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::addColumn<Test::XdgShellSurfaceType>("type");
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable;
}
void DontCrashNoBorder::testCreateWindow()
......@@ -115,8 +113,8 @@ void DontCrashNoBorder::testCreateWindow()
QScopedPointer<Surface> surface(Test::createSurface());
QVERIFY(!surface.isNull());
QFETCH(Test::ShellSurfaceType, type);
QScopedPointer<QObject> shellSurface(Test::createShellSurface(type, surface.data()));
QFETCH(Test::XdgShellSurfaceType, type);
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellSurface(type, surface.data()));
QVERIFY(shellSurface);
QScopedPointer<ServerSideDecoration> deco(Test::waylandServerSideDecoration()->create(surface.data()));
QSignalSpy decoSpy(deco.data(), &ServerSideDecoration::modeChanged);
......
......@@ -31,7 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/compositor.h>
#include <KWayland/Client/keyboard.h>
#include <KWayland/Client/pointer.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/seat.h>
#include <KWayland/Client/shm_pool.h>
#include <KWayland/Client/surface.h>
......@@ -93,7 +92,7 @@ void TestDontCrashUseractionsMenu::testShowHideShowUseractionsMenu()
{
// this test creates the condition of BUG 382063
QScopedPointer<Surface> surface1(Test::createSurface());
QScopedPointer<QObject> shellSurface1(Test::createShellSurface(Test::ShellSurfaceType::WlShell, surface1.data()));
QScopedPointer<XdgShellSurface> shellSurface1(Test::createXdgShellStableSurface(surface1.data()));
auto client = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue);
QVERIFY(client);
......
......@@ -31,7 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KConfigGroup>
#include <KWayland/Client/buffer.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/surface.h>
using namespace KWin;
......@@ -116,11 +115,11 @@ void FadeTest::cleanup()
void FadeTest::testWindowCloseAfterWindowHidden_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::addColumn<Test::XdgShellSurfaceType>("type");
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable;
}
void FadeTest::testWindowCloseAfterWindowHidden()
......@@ -139,8 +138,8 @@ void FadeTest::testWindowCloseAfterWindowHidden()
QVERIFY(windowClosedSpy.isValid());
QScopedPointer<Surface> surface(Test::createSurface());
QFETCH(Test::ShellSurfaceType, type);
QScopedPointer<QObject> shellSurface(Test::createShellSurface(type, surface.data()));
QFETCH(Test::XdgShellSurfaceType, type);
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellSurface(type, surface.data()));
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(c);
QTRY_COMPARE(windowAddedSpy.count(), 1);
......
......@@ -97,11 +97,11 @@ void MaximizeAnimationTest::cleanup()
void MaximizeAnimationTest::testMaximizeRestore_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::addColumn<Test::XdgShellSurfaceType>("type");
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable;
}
void MaximizeAnimationTest::testMaximizeRestore()
......@@ -115,7 +115,7 @@ void MaximizeAnimationTest::testMaximizeRestore()
QScopedPointer<Surface> surface(Test::createSurface());
QVERIFY(!surface.isNull());
QFETCH(Test::ShellSurfaceType, type);
QFETCH(Test::XdgShellSurfaceType, type);
QScopedPointer<XdgShellSurface> shellSurface(createXdgShellSurface(type, surface.data(), nullptr, Test::CreationSetup::CreateOnly));
// Wait for the initial configure event.
......
......@@ -36,7 +36,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/registry.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/slide.h>
#include <netwm.h>
......@@ -337,7 +336,7 @@ void SlidingPopupsTest::testWithOtherEffectWayland()
QScopedPointer<Slide> slide(slideManager->createSlide(surface.data()));
slide->setLocation(Slide::Location::Left);
slide->commit();
QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data()));
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
QVERIFY(shellSurface);
QCOMPARE(windowAddedSpy.count(), 0);
auto client = Test::renderAndWaitForShown(surface.data(), QSize(10, 20), Qt::blue);
......
......@@ -31,7 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KConfigGroup>
#include <KWayland/Client/buffer.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/surface.h>
using namespace KWin;
......
......@@ -35,7 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/registry.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/slide.h>
#include <netwm.h>
......
......@@ -29,7 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "wayland_server.h"
#include "workspace.h"
#include <KWayland/Client/shell.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Server/seat_interface.h>
......@@ -166,7 +165,7 @@ void GlobalShortcutsTest::testUserActionsMenu()
// first create a window
QScopedPointer<Surface> surface(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data()));
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(c);
QVERIFY(c->isActive());
......@@ -305,7 +304,7 @@ void GlobalShortcutsTest::testX11ClientShortcut()
void GlobalShortcutsTest::testWaylandClientShortcut()
{
QScopedPointer<Surface> surface(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data()));
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
QCOMPARE(workspace()->activeClient(), client);
......@@ -341,7 +340,7 @@ void GlobalShortcutsTest::testWaylandClientShortcut()
void GlobalShortcutsTest::testSetupWindowShortcut()
{
QScopedPointer<Surface> surface(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data()));
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
QCOMPARE(workspace()->activeClient(), client);
......
......@@ -84,12 +84,11 @@ void TestIdleInhibition::cleanup()
void TestIdleInhibition::testInhibit_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::addColumn<Test::XdgShellSurfaceType>("type");
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable;
}
void TestIdleInhibition::testInhibit()
......@@ -102,8 +101,8 @@ void TestIdleInhibition::testInhibit()
// now create window
QScopedPointer<Surface> surface(Test::createSurface());
QFETCH(Test::ShellSurfaceType, type);
QScopedPointer<QObject> shellSurface(Test::createShellSurface(type, surface.data()));
QFETCH(Test::XdgShellSurfaceType, type);
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellSurface(type, surface.data()));
// now create inhibition on window
QScopedPointer<IdleInhibitor> inhibitor(Test::waylandIdleInhibitManager()->createInhibitor(surface.data()));
......@@ -127,9 +126,6 @@ void TestIdleInhibition::testInhibit()
QVERIFY(idle->isInhibited());
shellSurface.reset();
if (type == Test::ShellSurfaceType::WlShell) {
surface.reset();
}
QVERIFY(Test::waitForWindowDestroyed(c));
QTRY_VERIFY(!idle->isInhibited());
QCOMPARE(inhibitedSpy.count(), 4);
......
......@@ -34,7 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/event_queue.h>
#include <KWayland/Client/registry.h>
#include <KWayland/Client/pointer.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/seat.h>
#include <KWayland/Client/shm_pool.h>
#include <KWayland/Client/surface.h>
......@@ -103,10 +102,11 @@ void InputStackingOrderTest::render(KWayland::Client::Surface *surface)
void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::addColumn<Test::XdgShellSurfaceType>("type");
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable;
}
void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange()
......@@ -130,8 +130,8 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange()
QVERIFY(clientAddedSpy.isValid());
Surface *surface1 = Test::createSurface(Test::waylandCompositor());
QVERIFY(surface1);
QFETCH(Test::ShellSurfaceType, type);
auto shellSurface1 = Test::createShellSurface(type, surface1, surface1);
QFETCH(Test::XdgShellSurfaceType, type);
XdgShellSurface *shellSurface1 = Test::createXdgShellSurface(type, surface1, surface1);
QVERIFY(shellSurface1);
render(surface1);
QVERIFY(clientAddedSpy.wait());
......@@ -140,7 +140,7 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange()
Surface *surface2 = Test::createSurface(Test::waylandCompositor());
QVERIFY(surface2);
auto shellSurface2 = Test::createShellSurface(type, surface2, surface2);
XdgShellSurface *shellSurface2 = Test::createXdgShellSurface(type, surface2, surface2);
QVERIFY(shellSurface2);
render(surface2);
QVERIFY(clientAddedSpy.wait());
......
......@@ -33,7 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/keyboard.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Client/seat.h>
#include <KWayland/Client/shell.h>
#include <KWindowSystem>
#include <KWayland/Server/surface_interface.h>
......@@ -390,7 +389,7 @@ void InternalWindowTest::testKeyboardTriggersLeave()
QSignalSpy leftSpy(keyboard.data(), &Keyboard::left);
QVERIFY(leftSpy.isValid());
QScopedPointer<Surface> surface(Test::createSurface());
QScopedPointer<QObject> shellSurface(Test::createShellSurface(Test::ShellSurfaceType::WlShell, surface.data()));
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
// now let's render
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
......
......@@ -30,7 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KGlobalAccel>
#include <KWayland/Client/surface.h>
#include <KWayland/Client/shell.h>
#include <QAction>
#include <QDBusConnection>
......@@ -364,7 +363,7 @@ void KeyboardLayoutTest::testWindowPolicy()
// create a window
using namespace KWayland::Client;
QScopedPointer<Surface> surface(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data()));
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
auto c1 = Test::renderAndWaitForShown(surface.data(), QSize(100, 100), Qt::blue);
QVERIFY(c1);
......@@ -380,7 +379,7 @@ void KeyboardLayoutTest::testWindowPolicy()
// create a second window
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface2(Test::createShellSurface(surface2.data()));
QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data()));
auto c2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 100), Qt::red);
QVERIFY(c2);
// this should have switched back to English
......@@ -411,7 +410,7 @@ void KeyboardLayoutTest::testApplicationPolicy()
// create a window
using namespace KWayland::Client;
QScopedPointer<Surface> surface(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data()));
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
auto c1 = Test::renderAndWaitForShown(surface.data(), QSize(100, 100), Qt::blue);
QVERIFY(c1);
......@@ -432,7 +431,7 @@ void KeyboardLayoutTest::testApplicationPolicy()
// create a second window
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface2(Test::createShellSurface(surface2.data()));
QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data()));
auto c2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 100), Qt::red);
QVERIFY(c2);
// it is the same application and should not switch the layout
......
......@@ -42,8 +42,6 @@ class PointerConstraints;
class Seat;
class ServerSideDecorationManager;
class ShadowManager;
class Shell;
class ShellSurface;
class ShmPool;
class SubCompositor;
class SubSurface;
......@@ -116,7 +114,6 @@ KWayland::Client::ConnectionThread *waylandConnection();
KWayland::Client::Compositor *waylandCompositor();
KWayland::Client::SubCompositor *waylandSubCompositor();
KWayland::Client::ShadowManager *waylandShadowManager();
KWayland::Client::Shell *waylandShell();
KWayland::Client::ShmPool *waylandShmPool();
KWayland::Client::Seat *waylandSeat();
KWayland::Client::ServerSideDecorationManager *waylandServerSideDecoration();
......@@ -136,8 +133,7 @@ void flushWaylandConnection();
KWayland::Client::Surface *createSurface(QObject *parent = nullptr);
KWayland::Client::SubSurface *createSubSurface(KWayland::Client::Surface *surface,
KWayland::Client::Surface *parentSurface, QObject *parent = nullptr);
enum class ShellSurfaceType {
WlShell,
enum class XdgShellSurfaceType {
XdgShellV5,
XdgShellV6,
XdgShellStable
......@@ -148,19 +144,11 @@ enum class CreationSetup {
CreateAndConfigure, /// commit and wait for the configure event, making this surface ready to commit buffers
};
/**
* Creates either a ShellSurface * or XdgShellSurface * as defined by @arg type
* For XDG top levels this method will block for a configure event, make this surface ready to commit buffers
*/
QObject *createShellSurface(ShellSurfaceType type, KWayland::Client::Surface *surface, QObject *parent = nullptr);
KWayland::Client::XdgShellSurface *createXdgShellSurface(ShellSurfaceType type,
KWayland::Client::XdgShellSurface *createXdgShellSurface(XdgShellSurfaceType type,
KWayland::Client::Surface *surface,
QObject *parent = nullptr,
CreationSetup creationSetup = CreationSetup::CreateAndConfigure);
KWayland::Client::ShellSurface *createShellSurface(KWayland::Client::Surface *surface,
QObject *parent = nullptr);
KWayland::Client::XdgShellSurface *createXdgShellV5Surface(KWayland::Client::Surface *surface,
QObject *parent = nullptr,
CreationSetup = CreationSetup::CreateAndConfigure);
......@@ -228,7 +216,7 @@ bool unlockScreen();
}
Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::Test::AdditionalWaylandInterfaces)
Q_DECLARE_METATYPE(KWin::Test::ShellSurfaceType)
Q_DECLARE_METATYPE(KWin::Test::XdgShellSurfaceType)
#define WAYLANDTEST_MAIN_HELPER(TestObject, DPI, OperationMode) \
int main(int argc, char *argv[]) \
......
......@@ -29,7 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "wayland_server.h"
#include "workspace.h"
#include <KWayland/Client/shell.h>
#include <KWayland/Client/surface.h>
#include <QDBusConnection>
......@@ -88,16 +87,16 @@ void KWinBindingsTest::testSwitchWindow()
{
// first create windows
QScopedPointer<Surface> surface1(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface1(Test::createShellSurface(surface1.data()));
QScopedPointer<XdgShellSurface> shellSurface1(Test::createXdgShellStableSurface(surface1.data()));
auto c1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue);
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface2(Test::createShellSurface(surface2.data()));
QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data()));
auto c2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue);
QScopedPointer<Surface> surface3(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface3(Test::createShellSurface(surface3.data()));
QScopedPointer<XdgShellSurface> shellSurface3(Test::createXdgShellStableSurface(surface3.data()));
auto c3 = Test::renderAndWaitForShown(surface3.data(), QSize(100, 50), Qt::blue);
QScopedPointer<Surface> surface4(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface4(Test::createShellSurface(surface4.data()));
QScopedPointer<XdgShellSurface> shellSurface4(Test::createXdgShellStableSurface(surface4.data()));
auto c4 = Test::renderAndWaitForShown(surface4.data(), QSize(100, 50), Qt::blue);
QVERIFY(c4->isActive());
......@@ -148,16 +147,16 @@ void KWinBindingsTest::testSwitchWindowScript()
// first create windows
QScopedPointer<Surface> surface1(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface1(Test::createShellSurface(surface1.data()));
QScopedPointer<XdgShellSurface> shellSurface1(Test::createXdgShellStableSurface(surface1.data()));
auto c1 = Test::renderAndWaitForShown(surface1.data(), QSize(100, 50), Qt::blue);
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface2(Test::createShellSurface(surface2.data()));
QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data()));
auto c2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue);
QScopedPointer<Surface> surface3(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface3(Test::createShellSurface(surface3.data()));
QScopedPointer<XdgShellSurface> shellSurface3(Test::createXdgShellStableSurface(surface3.data()));