From a5aaa9e3c45cd2b30af2dcc0f240cbc90dda62e5 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 13 Jan 2023 16:14:53 +0100 Subject: [PATCH] org.kde.KWin: Expose a window's UUID Exposes a Window's UUID so that it can be used with other APIs like window management or screencasting. --- autotests/integration/dbus_interface_test.cpp | 2 ++ src/dbusinterface.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/autotests/integration/dbus_interface_test.cpp b/autotests/integration/dbus_interface_test.cpp index 9755d4e262..77b1ae6abc 100644 --- a/autotests/integration/dbus_interface_test.cpp +++ b/autotests/integration/dbus_interface_test.cpp @@ -148,6 +148,7 @@ void TestDbusInterface::testGetWindowInfoXdgShellClient() QVERIFY(reply.isValid()); QVERIFY(!reply.isError()); auto windowData = reply.value(); + windowData.remove(QStringLiteral("uuid")); QCOMPARE(windowData, expectedData); auto verifyProperty = [window](const QString &name) { @@ -293,6 +294,7 @@ void TestDbusInterface::testGetWindowInfoX11Client() // not testing clientmachine as that is system dependent due to that also not testing localhost windowData.remove(QStringLiteral("clientMachine")); windowData.remove(QStringLiteral("localhost")); + windowData.remove(QStringLiteral("uuid")); QCOMPARE(windowData, expectedData); auto verifyProperty = [window](const QString &name) { diff --git a/src/dbusinterface.cpp b/src/dbusinterface.cpp index a67b17ee77..5a68796e9b 100644 --- a/src/dbusinterface.cpp +++ b/src/dbusinterface.cpp @@ -177,6 +177,7 @@ QVariantMap clientToVariantMap(const Window *c) {QStringLiteral("skipSwitcher"), c->skipSwitcher()}, {QStringLiteral("maximizeHorizontal"), c->maximizeMode() & MaximizeHorizontal}, {QStringLiteral("maximizeVertical"), c->maximizeMode() & MaximizeVertical}, + {QStringLiteral("uuid"), c->internalId().toString()}, #if KWIN_BUILD_ACTIVITIES {QStringLiteral("activities"), c->activities()}, #endif