diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-09-10 13:13:10 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-09-10 13:13:15 +0100 |
| commit | d490f198a47564805ab0ee122afa77d625661ae0 (patch) | |
| tree | f65a618cf206a73cdd0488b23d3e74312f9ec26e /src/managers/KeybindManager.cpp | |
| parent | a781c152ff9805c1a5c69c6d8575deee6fdce34b (diff) | |
keybinds: ignore mods on release of special binds
fixes #3208
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index e679d6da..cf0c573f 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -421,7 +421,10 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const std::string& Debug::log(LOG, "Keybind handling only locked (inhibitor)"); for (auto& k : m_lKeybinds) { - if (modmask != k.modmask || (g_pCompositor->m_sSeat.exclusiveClient && !k.locked) || k.submap != m_szCurrentSelectedSubmap || k.shadowed) + const bool SPECIALDISPATCHER = k.handler == "global" || k.handler == "pass" || k.handler == "mouse"; + const bool IGNOREMODS = SPECIALDISPATCHER && !pressed; // ignore mods. Pass, global dispatchers should be released immediately once the key is released. + + if ((modmask != k.modmask && !IGNOREMODS) || (g_pCompositor->m_sSeat.exclusiveClient && !k.locked) || k.submap != m_szCurrentSelectedSubmap || k.shadowed) continue; if (!key.empty()) { @@ -443,7 +446,7 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const std::string& continue; } - if (pressed && k.release && k.handler != "global" && k.handler != "pass" && k.handler != "mouse") { + if (pressed && k.release && !SPECIALDISPATCHER) { if (k.nonConsuming) continue; @@ -451,7 +454,7 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const std::string& continue; } - if (!pressed && !k.release && k.handler != "global" && k.handler != "pass" && k.handler != "mouse") { + if (!pressed && !k.release && !SPECIALDISPATCHER) { if (k.nonConsuming) continue; |
