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
This commit is contained in:
parent
421824b654
commit
db2ff13d4f
2 changed files with 2 additions and 2 deletions
|
@ -347,7 +347,6 @@ void ModifierOnlyShortcutTest::testGlobalShortcutsDisabled()
|
||||||
// Should not get triggered
|
// Should not get triggered
|
||||||
kwinApp()->platform()->keyboardKeyPressed(modifier, timestamp++);
|
kwinApp()->platform()->keyboardKeyPressed(modifier, timestamp++);
|
||||||
kwinApp()->platform()->keyboardKeyReleased(modifier, timestamp++);
|
kwinApp()->platform()->keyboardKeyReleased(modifier, timestamp++);
|
||||||
QEXPECT_FAIL("", "BUG 370146", Continue);
|
|
||||||
QCOMPARE(triggeredSpy.count(), 0);
|
QCOMPARE(triggeredSpy.count(), 0);
|
||||||
triggeredSpy.clear();
|
triggeredSpy.clear();
|
||||||
|
|
||||||
|
|
|
@ -310,7 +310,8 @@ void Xkb::updateKey(uint32_t key, InputRedirection::KeyboardKeyState state)
|
||||||
} else {
|
} else {
|
||||||
m_modOnlyShortcut.pressCount--;
|
m_modOnlyShortcut.pressCount--;
|
||||||
if (m_modOnlyShortcut.pressCount == 0 &&
|
if (m_modOnlyShortcut.pressCount == 0 &&
|
||||||
m_modifiers == Qt::NoModifier) {
|
m_modifiers == Qt::NoModifier &&
|
||||||
|
!workspace()->globalShortcutsDisabled()) {
|
||||||
if (m_modOnlyShortcut.modifier != Qt::NoModifier) {
|
if (m_modOnlyShortcut.modifier != Qt::NoModifier) {
|
||||||
const auto list = options->modifierOnlyDBusShortcut(m_modOnlyShortcut.modifier);
|
const auto list = options->modifierOnlyDBusShortcut(m_modOnlyShortcut.modifier);
|
||||||
if (list.size() >= 4) {
|
if (list.size() >= 4) {
|
||||||
|
|
Loading…
Reference in a new issue