From 2292f38f2e5290b691c53587df8b5c5a37df0545 Mon Sep 17 00:00:00 2001 From: Pasha Fistanto Date: Sat, 10 Aug 2024 19:42:34 +0200 Subject: [PATCH] fix: change separator to avoid conflicts with keyboards --- src/managers/input/InputManager.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 19a46ea9..38f4a05d 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -909,12 +909,9 @@ void CInputManager::setupKeyboard(SP keeb) { g_pKeybindManager->m_mKeyToCodeCache.clear(); } - // NOTE: This block is deprecated. g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", PKEEB->hlName + "," + LAYOUT}); + g_pEventManager->postEvent(SHyprIPCEvent{"activelayoutv2", PKEEB->hlName + "||" + LAYOUT}); EMIT_HOOK_EVENT("activeLayout", (std::vector{PKEEB, LAYOUT})); - - g_pEventManager->postEvent(SHyprIPCEvent{"activelayoutv2", PKEEB->hlName + ";" + LAYOUT}); - EMIT_HOOK_EVENT("activeLayoutv2", (std::vector{PKEEB, LAYOUT})); }, keeb.get()); @@ -978,13 +975,10 @@ void CInputManager::applyConfigToKeyboard(SP pKeyboard) { const auto LAYOUTSTR = pKeyboard->getActiveLayout(); - // NOTE: This block is deprecated. g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->hlName + "," + LAYOUTSTR}); + g_pEventManager->postEvent(SHyprIPCEvent{"activelayoutv2", pKeyboard->hlName + "||" + LAYOUTSTR}); EMIT_HOOK_EVENT("activeLayout", (std::vector{pKeyboard, LAYOUTSTR})); - g_pEventManager->postEvent(SHyprIPCEvent{"activelayoutv2", pKeyboard->hlName + ";" + LAYOUTSTR}); - EMIT_HOOK_EVENT("activeLayoutv2", (std::vector{pKeyboard, LAYOUTSTR})); - Debug::log(LOG, "Set the keyboard layout to {} and variant to {} for keyboard \"{}\"", pKeyboard->currentRules.layout, pKeyboard->currentRules.variant, pKeyboard->hlName); } @@ -1349,12 +1343,9 @@ void CInputManager::onKeyboardMod(SP pKeyboard) { Debug::log(LOG, "LAYOUT CHANGED TO {} GROUP {}", LAYOUT, MODS.group); - // NOTE: This block is deprecated. g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->hlName + "," + LAYOUT}); + g_pEventManager->postEvent(SHyprIPCEvent{"activelayoutv2", pKeyboard->hlName + "||" + LAYOUT}); EMIT_HOOK_EVENT("activeLayout", (std::vector{pKeyboard, LAYOUT})); - - g_pEventManager->postEvent(SHyprIPCEvent{"activelayoutv2", pKeyboard->hlName + ";" + LAYOUT}); - EMIT_HOOK_EVENT("activeLayoutv2", (std::vector{pKeyboard, LAYOUT})); } }