diff --git a/screenedge.h b/screenedge.h --- a/screenedge.h +++ b/screenedge.h @@ -239,6 +239,13 @@ */ int cornerOffset() const; /** + * Returns the options of a specific modifier. Example, is used for the + * Meta-only modifier in case the user has set its own qdbus settings + * @param mod the modifier key + * @return the user-set options for this modifier + */ + QStringList metaModifierOptions(Qt::KeyboardModifier mod) const; + /** * Mark the specified screen edge as reserved. This method is provided for external activation * like effects and scripts. When the effect/script does no longer need the edge it is supposed * to call @link unreserve. @@ -400,9 +407,10 @@ ElectricBorderAction m_actionBottom; ElectricBorderAction m_actionBottomLeft; ElectricBorderAction m_actionLeft; + QHash m_modifierOnlyShortcuts; QMap m_touchActions; int m_cornerOffset; - GestureRecognizer *m_gestureRecognizer; + GestureRecognizer *m_gestureRecognizer; KWIN_SINGLETON(ScreenEdges) }; @@ -514,6 +522,10 @@ return m_cornerOffset; } +inline QStringList ScreenEdges::metaModifierOptions(Qt::KeyboardModifier mod) const{ + return m_modifierOnlyShortcuts[mod]; +} + inline const QSize &ScreenEdges::cursorPushBackDistance() const { return m_cursorPushBackDistance; diff --git a/screenedge.cpp b/screenedge.cpp --- a/screenedge.cpp +++ b/screenedge.cpp @@ -367,13 +367,31 @@ return true; } case ElectricActionApplicationLauncher: { - QDBusConnection::sessionBus().asyncCall( - QDBusMessage::createMethodCall(QStringLiteral("org.kde.plasmashell"), - QStringLiteral("/PlasmaShell"), - QStringLiteral("org.kde.PlasmaShell"), - QStringLiteral("activateLauncherMenu") - ) - ); + const ScreenEdges *screenEdges = qobject_cast(parent()); + + QStringList list; + + if (screenEdges) { + list = screenEdges->metaModifierOptions(Qt::MetaModifier); + } + + if (list.size() >= 4 && list.at(3) == "activateLauncherMenu" ) { + auto call = QDBusMessage::createMethodCall(list.at(0), list.at(1), list.at(2), list.at(3)); + QVariantList args; + for (int i = 4; i < list.size(); ++i) { + args << list.at(i); + } + call.setArguments(args); + QDBusConnection::sessionBus().asyncCall(call); + } else { + QDBusConnection::sessionBus().asyncCall( + QDBusMessage::createMethodCall(QStringLiteral("org.kde.plasmashell"), + QStringLiteral("/PlasmaShell"), + QStringLiteral("org.kde.PlasmaShell"), + QStringLiteral("activateLauncherMenu") + ) + ); + } return true; } default: @@ -806,6 +824,8 @@ setActionForTouchBorder(ElectricRight, electricBorderAction(borderConfig.readEntry("Right", "None"))); setActionForTouchBorder(ElectricBottom, electricBorderAction(borderConfig.readEntry("Bottom", "None"))); setActionForTouchBorder(ElectricLeft, electricBorderAction(borderConfig.readEntry("Left", "None"))); + + m_modifierOnlyShortcuts[Qt::MetaModifier] = m_config->group("ModifierOnlyShortcuts").readEntry("Meta",QStringList()); } void ScreenEdges::setActionForBorder(ElectricBorder border, ElectricBorderAction *oldValue, ElectricBorderAction newValue)