[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:
parent
3577e6907a
commit
9ca24efc07
3 changed files with 26 additions and 0 deletions
|
@ -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::ShellSurface *createShellSurface(KWayland::Client::Surface *surface, QObject *parent = nullptr);
|
||||||
KWayland::Client::XdgShellSurface *createXdgShellV5Surface(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 *createXdgShellV6Surface(KWayland::Client::Surface *surface, QObject *parent = nullptr);
|
||||||
|
KWayland::Client::XdgShellSurface *createXdgShellStableSurface(KWayland::Client::Surface *surface, QObject *parent = nullptr);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -414,6 +414,7 @@ void TestShellClient::testFullscreen()
|
||||||
break;
|
break;
|
||||||
case Test::ShellSurfaceType::XdgShellV5:
|
case Test::ShellSurfaceType::XdgShellV5:
|
||||||
case Test::ShellSurfaceType::XdgShellV6:
|
case Test::ShellSurfaceType::XdgShellV6:
|
||||||
|
case Test::ShellSurfaceType::XdgShellStable:
|
||||||
xdgShellSurface = qobject_cast<XdgShellSurface*>(shellSurface.data());
|
xdgShellSurface = qobject_cast<XdgShellSurface*>(shellSurface.data());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -626,6 +627,7 @@ void TestShellClient::testMaximizedToFullscreen()
|
||||||
break;
|
break;
|
||||||
case Test::ShellSurfaceType::XdgShellV5:
|
case Test::ShellSurfaceType::XdgShellV5:
|
||||||
case Test::ShellSurfaceType::XdgShellV6:
|
case Test::ShellSurfaceType::XdgShellV6:
|
||||||
|
case Test::ShellSurfaceType::XdgShellStable:
|
||||||
xdgShellSurface = qobject_cast<XdgShellSurface*>(shellSurface.data());
|
xdgShellSurface = qobject_cast<XdgShellSurface*>(shellSurface.data());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -722,6 +724,7 @@ void TestShellClient::testMaximizedToFullscreen()
|
||||||
break;
|
break;
|
||||||
case Test::ShellSurfaceType::XdgShellV5:
|
case Test::ShellSurfaceType::XdgShellV5:
|
||||||
case Test::ShellSurfaceType::XdgShellV6:
|
case Test::ShellSurfaceType::XdgShellV6:
|
||||||
|
case Test::ShellSurfaceType::XdgShellStable:
|
||||||
qobject_cast<XdgShellSurface*>(shellSurface.data())->setFullscreen(false);
|
qobject_cast<XdgShellSurface*>(shellSurface.data())->setFullscreen(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -67,6 +67,7 @@ static struct {
|
||||||
Shell *shell = nullptr;
|
Shell *shell = nullptr;
|
||||||
XdgShell *xdgShellV5 = nullptr;
|
XdgShell *xdgShellV5 = nullptr;
|
||||||
XdgShell *xdgShellV6 = nullptr;
|
XdgShell *xdgShellV6 = nullptr;
|
||||||
|
XdgShell *xdgShellStable = nullptr;
|
||||||
ShmPool *shm = nullptr;
|
ShmPool *shm = nullptr;
|
||||||
Seat *seat = nullptr;
|
Seat *seat = nullptr;
|
||||||
PlasmaShell *plasmaShell = nullptr;
|
PlasmaShell *plasmaShell = nullptr;
|
||||||
|
@ -159,6 +160,10 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags)
|
||||||
if (!s_waylandConnection.xdgShellV6->isValid()) {
|
if (!s_waylandConnection.xdgShellV6->isValid()) {
|
||||||
return false;
|
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)) {
|
if (flags.testFlag(AdditionalWaylandInterface::Seat)) {
|
||||||
s_waylandConnection.seat = registry->createSeat(registry->interface(Registry::Interface::Seat).name, registry->interface(Registry::Interface::Seat).version);
|
s_waylandConnection.seat = registry->createSeat(registry->interface(Registry::Interface::Seat).name, registry->interface(Registry::Interface::Seat).version);
|
||||||
if (!s_waylandConnection.seat->isValid()) {
|
if (!s_waylandConnection.seat->isValid()) {
|
||||||
|
@ -237,6 +242,8 @@ void destroyWaylandConnection()
|
||||||
s_waylandConnection.xdgShellV5 = nullptr;
|
s_waylandConnection.xdgShellV5 = nullptr;
|
||||||
delete s_waylandConnection.xdgShellV6;
|
delete s_waylandConnection.xdgShellV6;
|
||||||
s_waylandConnection.xdgShellV6 = nullptr;
|
s_waylandConnection.xdgShellV6 = nullptr;
|
||||||
|
delete s_waylandConnection.xdgShellStable;
|
||||||
|
s_waylandConnection.xdgShellStable = nullptr;
|
||||||
delete s_waylandConnection.shell;
|
delete s_waylandConnection.shell;
|
||||||
s_waylandConnection.shell = nullptr;
|
s_waylandConnection.shell = nullptr;
|
||||||
delete s_waylandConnection.shadowManager;
|
delete s_waylandConnection.shadowManager;
|
||||||
|
@ -460,6 +467,19 @@ XdgShellSurface *createXdgShellV6Surface(Surface *surface, QObject *parent)
|
||||||
return s;
|
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)
|
QObject *createShellSurface(ShellSurfaceType type, KWayland::Client::Surface *surface, QObject *parent)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -469,6 +489,8 @@ QObject *createShellSurface(ShellSurfaceType type, KWayland::Client::Surface *su
|
||||||
return createXdgShellV5Surface(surface, parent);
|
return createXdgShellV5Surface(surface, parent);
|
||||||
case ShellSurfaceType::XdgShellV6:
|
case ShellSurfaceType::XdgShellV6:
|
||||||
return createXdgShellV6Surface(surface, parent);
|
return createXdgShellV6Surface(surface, parent);
|
||||||
|
case ShellSurfaceType::XdgShellStable:
|
||||||
|
return createXdgShellStableSurface(surface, parent);
|
||||||
default:
|
default:
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Reference in a new issue