Commit db2ff13d authored by Martin Flöser's avatar Martin Flöser

Only trigger mod-only-shortcuts if global shortcuts are enabled

Summary:
KWin supports blocking global shortcuts when a window is active through
window specific rules. This change ensures that the modifier only
shortcuts also honor the blocking of global shortcuts. If global
shortcuts are disabled, they won't trigger any more.

BUG: 370146
FIXED-IN: 5.8.1

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2952
parent 421824b6
......@@ -347,7 +347,6 @@ void ModifierOnlyShortcutTest::testGlobalShortcutsDisabled()
// Should not get triggered
kwinApp()->platform()->keyboardKeyPressed(modifier, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(modifier, timestamp++);
QEXPECT_FAIL("", "BUG 370146", Continue);
QCOMPARE(triggeredSpy.count(), 0);
triggeredSpy.clear();
......
......@@ -310,7 +310,8 @@ void Xkb::updateKey(uint32_t key, InputRedirection::KeyboardKeyState state)
} else {
m_modOnlyShortcut.pressCount--;
if (m_modOnlyShortcut.pressCount == 0 &&
m_modifiers == Qt::NoModifier) {
m_modifiers == Qt::NoModifier &&
!workspace()->globalShortcutsDisabled()) {
if (m_modOnlyShortcut.modifier != Qt::NoModifier) {
const auto list = options->modifierOnlyDBusShortcut(m_modOnlyShortcut.modifier);
if (list.size() >= 4) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment