From 3521631bbb83ce20bf8c4c679f33a87a31b5c98b Mon Sep 17 00:00:00 2001 From: Martin Seher Date: Thu, 7 Apr 2022 21:26:47 +0000 Subject: [PATCH] Add activeOutputName to DBus interface Provide the name of the active output via the DBus interface, so it can be used by other components, like KRunner (see bug 427069). CCBUG: 427069 --- src/dbusinterface.cpp | 6 ++++++ src/dbusinterface.h | 1 + src/org.kde.KWin.xml | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/dbusinterface.cpp b/src/dbusinterface.cpp index bd28ed7951..326dedb4bb 100644 --- a/src/dbusinterface.cpp +++ b/src/dbusinterface.cpp @@ -15,6 +15,7 @@ // kwin #include "abstract_client.h" +#include "abstract_output.h" #include "atoms.h" #include "composite.h" #include "debug_console.h" @@ -129,6 +130,11 @@ WRAP(QString, supportInformation) #undef WRAP +QString DBusInterface::activeOutputName() +{ + return Workspace::self()->activeOutput()->name(); +} + bool DBusInterface::startActivity(const QString &in0) { #if KWIN_BUILD_ACTIVITIES diff --git a/src/dbusinterface.h b/src/dbusinterface.h index 95157e12c6..ce78b0309b 100644 --- a/src/dbusinterface.h +++ b/src/dbusinterface.h @@ -56,6 +56,7 @@ public Q_SLOTS: // METHODS bool startActivity(const QString &in0); bool stopActivity(const QString &in0); QString supportInformation(); + QString activeOutputName(); Q_NOREPLY void unclutterDesktop(); Q_NOREPLY void showDebugConsole(); diff --git a/src/org.kde.KWin.xml b/src/org.kde.KWin.xml index fe06fd03d9..8600a681cf 100644 --- a/src/org.kde.KWin.xml +++ b/src/org.kde.KWin.xml @@ -35,6 +35,9 @@ + + +