From 7a3b57c99c1501055512174f94840153f4e65c71 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 4 Sep 2022 18:46:28 +0200 Subject: [PATCH] send accumulated modifiers to surfaces --- src/managers/input/InputManager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index af950b5b..bdf33969 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -794,12 +794,17 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar void CInputManager::onKeyboardMod(void* data, SKeyboard* pKeyboard) { const auto PIMEGRAB = m_sIMERelay.getIMEKeyboardGrab(pKeyboard); + const auto ALLMODS = accumulateModsFromAllKBs(); + + auto MODS = wlr_keyboard_from_input_device(pKeyboard->keyboard)->modifiers; + MODS.depressed = ALLMODS; + if (PIMEGRAB && PIMEGRAB->pWlrKbGrab && PIMEGRAB->pWlrKbGrab->input_method) { wlr_input_method_keyboard_grab_v2_set_keyboard(PIMEGRAB->pWlrKbGrab, wlr_keyboard_from_input_device(pKeyboard->keyboard)); - wlr_input_method_keyboard_grab_v2_send_modifiers(PIMEGRAB->pWlrKbGrab, &wlr_keyboard_from_input_device(pKeyboard->keyboard)->modifiers); + wlr_input_method_keyboard_grab_v2_send_modifiers(PIMEGRAB->pWlrKbGrab, &MODS); } else { wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, wlr_keyboard_from_input_device(pKeyboard->keyboard)); - wlr_seat_keyboard_notify_modifiers(g_pCompositor->m_sSeat.seat, &wlr_keyboard_from_input_device(pKeyboard->keyboard)->modifiers); + wlr_seat_keyboard_notify_modifiers(g_pCompositor->m_sSeat.seat, &MODS); } const auto PWLRKB = wlr_keyboard_from_input_device(pKeyboard->keyboard);