Tests: Add outputmanagement to test helper

This commit is contained in:
Méven Car 2020-06-24 11:17:42 +02:00
parent ad73e13478
commit 61b55732ae
2 changed files with 17 additions and 0 deletions

View file

@ -47,6 +47,7 @@ class SubCompositor;
class SubSurface; class SubSurface;
class Surface; class Surface;
class XdgDecorationManager; class XdgDecorationManager;
class OutputManagement;
} }
} }
@ -91,6 +92,7 @@ enum class AdditionalWaylandInterface {
AppMenu = 1 << 6, AppMenu = 1 << 6,
ShadowManager = 1 << 7, ShadowManager = 1 << 7,
XdgDecoration = 1 << 8, XdgDecoration = 1 << 8,
OutputManagement = 1 << 9,
}; };
Q_DECLARE_FLAGS(AdditionalWaylandInterfaces, AdditionalWaylandInterface) Q_DECLARE_FLAGS(AdditionalWaylandInterfaces, AdditionalWaylandInterface)
/** /**
@ -122,6 +124,7 @@ KWayland::Client::PointerConstraints *waylandPointerConstraints();
KWayland::Client::IdleInhibitManager *waylandIdleInhibitManager(); KWayland::Client::IdleInhibitManager *waylandIdleInhibitManager();
KWayland::Client::AppMenuManager *waylandAppMenuManager(); KWayland::Client::AppMenuManager *waylandAppMenuManager();
KWayland::Client::XdgDecorationManager *xdgDecorationManager(); KWayland::Client::XdgDecorationManager *xdgDecorationManager();
KWayland::Client::OutputManagement *waylandOutputManagement();
bool waitForWaylandPointer(); bool waitForWaylandPointer();
bool waitForWaylandTouch(); bool waitForWaylandTouch();

View file

@ -41,6 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/appmenu.h> #include <KWayland/Client/appmenu.h>
#include <KWayland/Client/xdgshell.h> #include <KWayland/Client/xdgshell.h>
#include <KWayland/Client/xdgdecoration.h> #include <KWayland/Client/xdgdecoration.h>
#include <KWayland/Client/outputmanagement.h>
#include <KWaylandServer/display.h> #include <KWaylandServer/display.h>
//screenlocker //screenlocker
@ -74,6 +75,7 @@ static struct {
PlasmaWindowManagement *windowManagement = nullptr; PlasmaWindowManagement *windowManagement = nullptr;
PointerConstraints *pointerConstraints = nullptr; PointerConstraints *pointerConstraints = nullptr;
Registry *registry = nullptr; Registry *registry = nullptr;
OutputManagement* outputManagement = nullptr;
QThread *thread = nullptr; QThread *thread = nullptr;
QVector<Output*> outputs; QVector<Output*> outputs;
IdleInhibitManager *idleInhibit = nullptr; IdleInhibitManager *idleInhibit = nullptr;
@ -177,6 +179,13 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags)
return false; return false;
} }
} }
if (flags.testFlag(AdditionalWaylandInterface::OutputManagement)) {
s_waylandConnection.outputManagement = registry->createOutputManagement(registry->interface(Registry::Interface::OutputManagement).name,
registry->interface(Registry::Interface::OutputManagement).version);
if (!s_waylandConnection.outputManagement->isValid()) {
return false;
}
}
if (flags.testFlag(AdditionalWaylandInterface::PlasmaShell)) { if (flags.testFlag(AdditionalWaylandInterface::PlasmaShell)) {
s_waylandConnection.plasmaShell = registry->createPlasmaShell(registry->interface(Registry::Interface::PlasmaShell).name, s_waylandConnection.plasmaShell = registry->createPlasmaShell(registry->interface(Registry::Interface::PlasmaShell).name,
registry->interface(Registry::Interface::PlasmaShell).version); registry->interface(Registry::Interface::PlasmaShell).version);
@ -334,6 +343,11 @@ XdgDecorationManager *xdgDecorationManager()
return s_waylandConnection.xdgDecoration; return s_waylandConnection.xdgDecoration;
} }
OutputManagement *waylandOutputManagement()
{
return s_waylandConnection.outputManagement;
}
bool waitForWaylandPointer() bool waitForWaylandPointer()
{ {