diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-05-17 19:28:33 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-05-17 19:28:33 +0100 |
| commit | 23cd4c7998cc4308e5db9b64994ebd6b27c38877 (patch) | |
| tree | 63b2400a2851fb167fd21a6363b16b3b66ce17ec /src | |
| parent | 0cb8fbe18e45936ef3e3c6f82fcd200affc9fb13 (diff) | |
seat: update keymap/repeat info on keymap events from keebs
fixes #6114
Diffstat (limited to 'src')
| -rw-r--r-- | src/managers/SeatManager.cpp | 11 | ||||
| -rw-r--r-- | src/managers/SeatManager.hpp | 1 | ||||
| -rw-r--r-- | src/managers/input/InputManager.cpp | 3 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/managers/SeatManager.cpp b/src/managers/SeatManager.cpp index 2087122a..bbbe01d4 100644 --- a/src/managers/SeatManager.cpp +++ b/src/managers/SeatManager.cpp @@ -86,10 +86,15 @@ void CSeatManager::setKeyboard(SP<IKeyboard> KEEB) { keyboard->active = false; keyboard = KEEB; - if (KEEB) { + if (KEEB) KEEB->active = true; - PROTO::seat->updateRepeatInfo(KEEB->wlr()->repeat_info.rate, KEEB->wlr()->repeat_info.delay); - } + + updateActiveKeyboardData(); +} + +void CSeatManager::updateActiveKeyboardData() { + if (keyboard) + PROTO::seat->updateRepeatInfo(keyboard->wlr()->repeat_info.rate, keyboard->wlr()->repeat_info.delay); PROTO::seat->updateKeymap(); } diff --git a/src/managers/SeatManager.hpp b/src/managers/SeatManager.hpp index cf5e9216..fee3efa9 100644 --- a/src/managers/SeatManager.hpp +++ b/src/managers/SeatManager.hpp @@ -54,6 +54,7 @@ class CSeatManager { void setMouse(SP<IPointer> mouse); void setKeyboard(SP<IKeyboard> keeb); + void updateActiveKeyboardData(); // updates the clients with the keymap and repeat info void setKeyboardFocus(wlr_surface* surf); void sendKeyboardKey(uint32_t timeMs, uint32_t key, wl_keyboard_key_state state); diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 58e5ad17..e05520f4 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -839,6 +839,9 @@ void CInputManager::setupKeyboard(SP<IKeyboard> keeb) { auto PKEEB = ((IKeyboard*)owner)->self.lock(); const auto LAYOUT = PKEEB->getActiveLayout(); + if (PKEEB == g_pSeatManager->keyboard) + g_pSeatManager->updateActiveKeyboardData(); + g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", PKEEB->hlName + "," + LAYOUT}); EMIT_HOOK_EVENT("activeLayout", (std::vector<std::any>{PKEEB, LAYOUT})); }, |
