From 4a16bbbe468214057f975da29142dce36ab7411e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 10 Aug 2016 15:07:54 +0200 Subject: [PATCH] Support triggering application launcher through screenedge Summary: Now that we have a dedicated dbus call to show the application launcher we can also expose it through the screenedges. Reviewers: #kwin, #plasma Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D2394 --- kcmkwin/kwinscreenedges/main.cpp | 4 ++++ libkwineffects/kwinglobals.h | 1 + screenedge.cpp | 12 ++++++++++++ 3 files changed, 17 insertions(+) diff --git a/kcmkwin/kwinscreenedges/main.cpp b/kcmkwin/kwinscreenedges/main.cpp index e0f7639d8f..cf864bc222 100644 --- a/kcmkwin/kwinscreenedges/main.cpp +++ b/kcmkwin/kwinscreenedges/main.cpp @@ -189,6 +189,7 @@ void KWinScreenEdgesConfig::monitorInit() monitorAddItem(i18n("Lock Screen")); monitorAddItem(i18nc("Open krunner", "Run Command")); monitorAddItem(i18n("Activity Manager")); + monitorAddItem(i18n("Application Launcher")); // Add the effects const QString presentWindowsName = BuiltInEffects::effectData(BuiltInEffect::PresentWindows).displayName; @@ -215,6 +216,7 @@ void KWinScreenEdgesConfig::monitorLoadAction(ElectricBorder edge, const QString else if (lowerName == "lockscreen") monitorChangeEdge(edge, int(ElectricActionLockScreen)); else if (lowerName == "krunner") monitorChangeEdge(edge, int(ElectricActionKRunner)); else if (lowerName == "activitymanager") monitorChangeEdge(edge, int(ElectricActionActivityManager)); + else if (lowerName == "applicationlauncher") monitorChangeEdge(edge, int(ElectricActionApplicationLauncher)); } void KWinScreenEdgesConfig::monitorLoad() @@ -315,6 +317,8 @@ void KWinScreenEdgesConfig::monitorSaveAction(int edge, const QString& configNam config.writeEntry(configName, "KRunner"); else if (item == 4) config.writeEntry(configName, "ActivityManager"); + else if (item == 5) + config.writeEntry(configName, "ApplicationLauncher"); else // Anything else config.writeEntry(configName, "None"); } diff --git a/libkwineffects/kwinglobals.h b/libkwineffects/kwinglobals.h index 3ae0d36b54..2926402596 100644 --- a/libkwineffects/kwinglobals.h +++ b/libkwineffects/kwinglobals.h @@ -95,6 +95,7 @@ enum ElectricBorderAction { ElectricActionLockScreen, // Lock screen ElectricActionKRunner, // Open KRunner ElectricActionActivityManager, // Activity Manager + ElectricActionApplicationLauncher, // Application Launcher ELECTRIC_ACTION_COUNT }; diff --git a/screenedge.cpp b/screenedge.cpp index 52e5ec73c5..4566cf1859 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -262,6 +262,16 @@ bool Edge::handleAction() ); return true; } + case ElectricActionApplicationLauncher: { + QDBusConnection::sessionBus().asyncCall( + QDBusMessage::createMethodCall(QStringLiteral("org.kde.plasmashell"), + QStringLiteral("/PlasmaShell"), + QStringLiteral("org.kde.PlasmaShell"), + QStringLiteral("activateLauncherMenu") + ) + ); + return true; + } default: return false; } @@ -576,6 +586,8 @@ static ElectricBorderAction electricBorderAction(const QString& name) return ElectricActionKRunner; } else if (lowerName == QLatin1String("activitymanager")) { return ElectricActionActivityManager; + } else if (lowerName == QLatin1String("applicationlauncher")) { + return ElectricActionApplicationLauncher; } return ElectricActionNone; }