diff --git a/hyprtester/src/tests/main/keybinds.cpp b/hyprtester/src/tests/main/keybinds.cpp index 589d5bb5a..fabf11028 100644 --- a/hyprtester/src/tests/main/keybinds.cpp +++ b/hyprtester/src/tests/main/keybinds.cpp @@ -459,6 +459,14 @@ SUBTEST(submap) { press(KEY_P); EXPECT_CONTAINS(getFromSocket("/submap"), "default"); + // submap 1 with identical keybind bound inside it + press(KEY_U, MOD_META); + EXPECT_CONTAINS(getFromSocket("/submap"), "submap1"); + press(KEY_U, MOD_META); + EXPECT_CONTAINS(getFromSocket("/submap"), "submap3"); + press(KEY_O); + Tests::waitUntilWindowsN(4); + EXPECT_CONTAINS(getFromSocket("/submap"), "default"); Tests::killAllWindows(); } diff --git a/hyprtester/test.lua b/hyprtester/test.lua index 693513aeb..98956f6ae 100644 --- a/hyprtester/test.lua +++ b/hyprtester/test.lua @@ -201,6 +201,7 @@ hl.bind(mainMod .. " + u", hl.dsp.submap("submap1")) hl.define_submap("submap1", function() hl.bind("u", hl.dsp.submap("submap2")) + hl.bind(mainMod .. " + u", hl.dsp.submap("submap3")) hl.bind("i", hl.dsp.submap("submap3")) hl.bind("o", hl.dsp.exec_cmd(terminal)) hl.bind("p", hl.dsp.submap("reset")) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index a8e9dab9b..acbca0f28 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -613,7 +613,7 @@ SDispatchResult CKeybindManager::handleKeybinds(const uint32_t modmask, const SP if (!k->locked && g_pSessionLockManager->isSessionLocked()) continue; - if (!IGNORECONDITIONS && ((modmask != k->modmask && !k->ignoreMods) || (k->submap.name != Config::Actions::state()->m_currentSubmap && !k->submapUniversal) || k->shadowed)) + if (!IGNORECONDITIONS && ((modmask != k->modmask && !k->ignoreMods) || ((k->submap.name != key.submapAtPress.name) && !k->submapUniversal) || k->shadowed)) continue; if (device) {