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
This commit is contained in:
Martin Gräßlin 2016-08-10 15:07:54 +02:00
parent 7bca270f97
commit 4a16bbbe46
3 changed files with 17 additions and 0 deletions

View file

@ -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");
}

View file

@ -95,6 +95,7 @@ enum ElectricBorderAction {
ElectricActionLockScreen, // Lock screen
ElectricActionKRunner, // Open KRunner
ElectricActionActivityManager, // Activity Manager
ElectricActionApplicationLauncher, // Application Launcher
ELECTRIC_ACTION_COUNT
};

View file

@ -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;
}