diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h
index 0d40aef26a..82e0fc25ad 100644
--- a/autotests/integration/kwin_wayland_test.h
+++ b/autotests/integration/kwin_wayland_test.h
@@ -29,6 +29,7 @@ namespace KWayland
{
namespace Client
{
+class AppMenuManager;
class ConnectionThread;
class Compositor;
class IdleInhibitManager;
@@ -83,7 +84,8 @@ enum class AdditionalWaylandInterface {
PlasmaShell = 1 << 2,
WindowManagement = 1 << 3,
PointerConstraints = 1 << 4,
- IdleInhibition = 1 << 5
+ IdleInhibition = 1 << 5,
+ AppMenu = 1 << 6
};
Q_DECLARE_FLAGS(AdditionalWaylandInterfaces, AdditionalWaylandInterface)
/**
@@ -112,6 +114,8 @@ KWayland::Client::PlasmaShell *waylandPlasmaShell();
KWayland::Client::PlasmaWindowManagement *waylandWindowManagement();
KWayland::Client::PointerConstraints *waylandPointerConstraints();
KWayland::Client::IdleInhibitManager *waylandIdleInhibitManager();
+KWayland::Client::AppMenuManager *waylandAppMenuManager();
+
bool waitForWaylandPointer();
bool waitForWaylandTouch();
diff --git a/autotests/integration/shell_client_test.cpp b/autotests/integration/shell_client_test.cpp
index ad4929c99e..d4a0f8fd81 100644
--- a/autotests/integration/shell_client_test.cpp
+++ b/autotests/integration/shell_client_test.cpp
@@ -33,11 +33,13 @@ along with this program. If not, see .
#include
#include
#include
+#include
#include
#include
#include
+
// system
#include
#include
@@ -84,6 +86,7 @@ private Q_SLOTS:
void testUnresponsiveWindow();
void testX11WindowId_data();
void testX11WindowId();
+ void testAppMenu();
};
void TestShellClient::initTestCase()
@@ -108,7 +111,8 @@ void TestShellClient::initTestCase()
void TestShellClient::init()
{
- QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Decoration));
+ QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Decoration |
+ Test::AdditionalWaylandInterface::AppMenu));
screens()->setCurrent(0);
KWin::Cursor::setPos(QPoint(1280, 512));
@@ -955,5 +959,21 @@ void TestShellClient::testX11WindowId()
QCOMPARE(c->window(), 0u);
}
+void TestShellClient::testAppMenu()
+{
+ QScopedPointer surface(Test::createSurface());
+ QScopedPointer shellSurface(Test::createShellSurface(Test::ShellSurfaceType::XdgShellV6, surface.data()));
+ auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
+ QVERIFY(c);
+ QScopedPointer menu(Test::waylandAppMenuManager()->create(surface.data()));
+ QSignalSpy spy(c, &ShellClient::hasApplicationMenuChanged);
+ menu->setAddress("service.name", "object/path");
+ spy.wait();
+ QCOMPARE(c->hasApplicationMenu(), true);
+ QCOMPARE(c->applicationMenuServiceName(), "service.name");
+ QCOMPARE(c->applicationMenuObjectPath(), "object/path");
+}
+
+
WAYLANDTEST_MAIN(TestShellClient)
#include "shell_client_test.moc"
diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp
index 7f6fb61e7b..a94f7e8d88 100644
--- a/autotests/integration/test_helpers.cpp
+++ b/autotests/integration/test_helpers.cpp
@@ -36,6 +36,7 @@ along with this program. If not, see .
#include
#include
#include
+#include
#include
#include
@@ -73,6 +74,7 @@ static struct {
QThread *thread = nullptr;
QVector