From 6ccc22194ca2d16bd7dc4b7263f897a547c50e6b Mon Sep 17 00:00:00 2001 From: Ikalco <73481042+ikalco@users.noreply.github.com> Date: Tue, 7 May 2024 10:07:50 -0500 Subject: xkb: check value correctly with xkb_state_layout_index_is_active() (#5925) --- src/devices/IKeyboard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/devices/IKeyboard.cpp') diff --git a/src/devices/IKeyboard.cpp b/src/devices/IKeyboard.cpp index 61b078fb..61c78f5b 100644 --- a/src/devices/IKeyboard.cpp +++ b/src/devices/IKeyboard.cpp @@ -36,7 +36,7 @@ void IKeyboard::updateXKBTranslationState(xkb_keymap* const keymap) { const auto PCONTEXT = xkb_context_new(XKB_CONTEXT_NO_FLAGS); for (uint32_t i = 0; i < LAYOUTSNUM; ++i) { - if (xkb_state_layout_index_is_active(STATE, i, XKB_STATE_LAYOUT_EFFECTIVE)) { + if (xkb_state_layout_index_is_active(STATE, i, XKB_STATE_LAYOUT_EFFECTIVE) == 1) { Debug::log(LOG, "Updating keyboard {:x}'s translation state from an active index {}", (uintptr_t)this, i); CVarList keyboardLayouts(currentRules.layout, 0, ','); @@ -103,7 +103,7 @@ std::string IKeyboard::getActiveLayout() { const auto LAYOUTSNUM = xkb_keymap_num_layouts(KEYMAP); for (uint32_t i = 0; i < LAYOUTSNUM; ++i) { - if (xkb_state_layout_index_is_active(STATE, i, XKB_STATE_LAYOUT_EFFECTIVE)) { + if (xkb_state_layout_index_is_active(STATE, i, XKB_STATE_LAYOUT_EFFECTIVE) == 1) { const auto LAYOUTNAME = xkb_keymap_layout_get_name(KEYMAP, i); if (LAYOUTNAME) -- cgit v1.2.3