mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 01:05:59 +01:00
input: fix active keyboard for seat after destroying one (#5725)
* fix: manage active keyboard for seat after destroying one * chore: clang-format
This commit is contained in:
parent
d119513749
commit
31d055f6d4
1 changed files with 9 additions and 10 deletions
|
@ -1152,17 +1152,16 @@ void CInputManager::destroyKeyboard(SKeyboard* pKeyboard) {
|
||||||
|
|
||||||
xkb_state_unref(pKeyboard->xkbTranslationState);
|
xkb_state_unref(pKeyboard->xkbTranslationState);
|
||||||
|
|
||||||
if (pKeyboard->active) {
|
m_lKeyboards.remove(*pKeyboard);
|
||||||
m_lKeyboards.remove(*pKeyboard);
|
|
||||||
|
|
||||||
if (m_lKeyboards.size() > 0) {
|
if (m_lKeyboards.size() > 0) {
|
||||||
m_pActiveKeyboard = &m_lKeyboards.back();
|
m_pActiveKeyboard = &m_lKeyboards.back();
|
||||||
m_pActiveKeyboard->active = true;
|
m_pActiveKeyboard->active = true;
|
||||||
} else {
|
wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, wlr_keyboard_from_input_device(m_pActiveKeyboard->keyboard));
|
||||||
m_pActiveKeyboard = nullptr;
|
} else {
|
||||||
}
|
m_pActiveKeyboard = nullptr;
|
||||||
} else
|
wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, nullptr);
|
||||||
m_lKeyboards.remove(*pKeyboard);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::destroyMouse(wlr_input_device* mouse) {
|
void CInputManager::destroyMouse(wlr_input_device* mouse) {
|
||||||
|
|
Loading…
Reference in a new issue