[autotests] Hook up some missing tests for XDGShellStable

Summary: No kwin changes

Test Plan:
Compiles
More tests pass

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16148
This commit is contained in:
David Edmundson 2018-10-15 15:02:53 +01:00
parent 3577e6907a
commit 9ca24efc07
3 changed files with 26 additions and 0 deletions

View file

@ -137,6 +137,7 @@ QObject *createShellSurface(ShellSurfaceType type, KWayland::Client::Surface *su
KWayland::Client::ShellSurface *createShellSurface(KWayland::Client::Surface *surface, QObject *parent = nullptr);
KWayland::Client::XdgShellSurface *createXdgShellV5Surface(KWayland::Client::Surface *surface, QObject *parent = nullptr);
KWayland::Client::XdgShellSurface *createXdgShellV6Surface(KWayland::Client::Surface *surface, QObject *parent = nullptr);
KWayland::Client::XdgShellSurface *createXdgShellStableSurface(KWayland::Client::Surface *surface, QObject *parent = nullptr);
/**

View file

@ -414,6 +414,7 @@ void TestShellClient::testFullscreen()
break;
case Test::ShellSurfaceType::XdgShellV5:
case Test::ShellSurfaceType::XdgShellV6:
case Test::ShellSurfaceType::XdgShellStable:
xdgShellSurface = qobject_cast<XdgShellSurface*>(shellSurface.data());
break;
default:
@ -626,6 +627,7 @@ void TestShellClient::testMaximizedToFullscreen()
break;
case Test::ShellSurfaceType::XdgShellV5:
case Test::ShellSurfaceType::XdgShellV6:
case Test::ShellSurfaceType::XdgShellStable:
xdgShellSurface = qobject_cast<XdgShellSurface*>(shellSurface.data());
break;
default:
@ -722,6 +724,7 @@ void TestShellClient::testMaximizedToFullscreen()
break;
case Test::ShellSurfaceType::XdgShellV5:
case Test::ShellSurfaceType::XdgShellV6:
case Test::ShellSurfaceType::XdgShellStable:
qobject_cast<XdgShellSurface*>(shellSurface.data())->setFullscreen(false);
break;
default:

View file

@ -67,6 +67,7 @@ static struct {
Shell *shell = nullptr;
XdgShell *xdgShellV5 = nullptr;
XdgShell *xdgShellV6 = nullptr;
XdgShell *xdgShellStable = nullptr;
ShmPool *shm = nullptr;
Seat *seat = nullptr;
PlasmaShell *plasmaShell = nullptr;
@ -159,6 +160,10 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags)
if (!s_waylandConnection.xdgShellV6->isValid()) {
return false;
}
s_waylandConnection.xdgShellStable = registry->createXdgShell(registry->interface(Registry::Interface::XdgShellStable).name, registry->interface(Registry::Interface::XdgShellStable).version);
if (!s_waylandConnection.xdgShellStable->isValid()) {
return false;
}
if (flags.testFlag(AdditionalWaylandInterface::Seat)) {
s_waylandConnection.seat = registry->createSeat(registry->interface(Registry::Interface::Seat).name, registry->interface(Registry::Interface::Seat).version);
if (!s_waylandConnection.seat->isValid()) {
@ -237,6 +242,8 @@ void destroyWaylandConnection()
s_waylandConnection.xdgShellV5 = nullptr;
delete s_waylandConnection.xdgShellV6;
s_waylandConnection.xdgShellV6 = nullptr;
delete s_waylandConnection.xdgShellStable;
s_waylandConnection.xdgShellStable = nullptr;
delete s_waylandConnection.shell;
s_waylandConnection.shell = nullptr;
delete s_waylandConnection.shadowManager;
@ -460,6 +467,19 @@ XdgShellSurface *createXdgShellV6Surface(Surface *surface, QObject *parent)
return s;
}
XdgShellSurface *createXdgShellStableSurface(Surface *surface, QObject *parent)
{
if (!s_waylandConnection.xdgShellStable) {
return nullptr;
}
auto s = s_waylandConnection.xdgShellStable->createSurface(surface, parent);
if (!s->isValid()) {
delete s;
return nullptr;
}
return s;
}
QObject *createShellSurface(ShellSurfaceType type, KWayland::Client::Surface *surface, QObject *parent)
{
switch (type) {
@ -469,6 +489,8 @@ QObject *createShellSurface(ShellSurfaceType type, KWayland::Client::Surface *su
return createXdgShellV5Surface(surface, parent);
case ShellSurfaceType::XdgShellV6:
return createXdgShellV6Surface(surface, parent);
case ShellSurfaceType::XdgShellStable:
return createXdgShellStableSurface(surface, parent);
default:
Q_UNREACHABLE();
return nullptr;