summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/shared/mockcompositor.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-02-22 15:33:40 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-03-08 16:13:33 +0000
commit18175b6eb8d8cfdc12003186ec1829579a35fef4 (patch)
treecd1cbc5519535e1aa3f951c4d8e0888eb7ed4dc4 /tests/auto/client/shared/mockcompositor.cpp
parent42a51460a34a4e593013e788089b1fc6bfe405fc (diff)
Client test for xdg-shell v6 configure events
Task-number: QTBUG-66689 Change-Id: Ifdf38a9ab73357fdbe61e77f0464b227ddd2e8ac Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests/auto/client/shared/mockcompositor.cpp')
-rw-r--r--tests/auto/client/shared/mockcompositor.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/client/shared/mockcompositor.cpp b/tests/auto/client/shared/mockcompositor.cpp
index ef2636b0f..c11d952a7 100644
--- a/tests/auto/client/shared/mockcompositor.cpp
+++ b/tests/auto/client/shared/mockcompositor.cpp
@@ -219,6 +219,14 @@ void MockCompositor::sendSurfaceLeave(const QSharedPointer<MockSurface> &surface
processCommand(command);
}
+void MockCompositor::sendXdgToplevelV6Configure(const QSharedPointer<MockXdgToplevelV6> toplevel, const QSize &size)
+{
+ Command command = makeCommand(Impl::Compositor::sendXdgToplevelV6Configure, m_compositor);
+ command.parameters << QVariant::fromValue(toplevel);
+ command.parameters << QVariant::fromValue(size);
+ processCommand(command);
+}
+
void MockCompositor::waitForStartDrag()
{
Command command = makeCommand(Impl::Compositor::waitForStartDrag, m_compositor);
@@ -251,6 +259,16 @@ QSharedPointer<MockOutput> MockCompositor::output(int index)
return result;
}
+QSharedPointer<MockXdgToplevelV6> MockCompositor::xdgToplevelV6(int index)
+{
+ QSharedPointer<MockXdgToplevelV6> result;
+ lock();
+ if (Impl::XdgToplevelV6 *toplevel = m_compositor->xdgShellV6()->toplevels().value(index, nullptr))
+ result = toplevel->mockToplevel();
+ unlock();
+ return result;
+}
+
MockCompositor::Command MockCompositor::makeCommand(Command::Callback callback, void *target)
{
Command command;
@@ -400,6 +418,11 @@ QVector<Output *> Compositor::outputs() const
return m_outputs;
}
+XdgShellV6 *Compositor::xdgShellV6() const
+{
+ return m_xdgShellV6.data();
+}
+
uint32_t Compositor::nextSerial()
{
return wl_display_next_serial(m_display);
@@ -429,5 +452,10 @@ Output *Compositor::resolveOutput(const QVariant &v)
return mockOutput ? mockOutput->handle() : nullptr;
}
+XdgToplevelV6 *Compositor::resolveToplevel(const QVariant &v)
+{
+ QSharedPointer<MockXdgToplevelV6> mockToplevel = v.value<QSharedPointer<MockXdgToplevelV6>>();
+ return mockToplevel ? mockToplevel->handle() : nullptr;
}
+}