aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/devices/IKeyboard.cpp
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2024-10-08 13:15:53 +0100
committervaxerski <[email protected]>2024-10-08 13:15:58 +0100
commite0cfbec66b97edb2957508152f32e77a1b181afc (patch)
tree6b55bfc9e001b5d4c0732d29003f74c1e26b002a /src/devices/IKeyboard.cpp
parentb3a7e3109bf2b7b4422424471130197dc08baeb1 (diff)
downloadHyprland-e0cfbec66b97edb2957508152f32e77a1b181afc.tar.gz
Hyprland-e0cfbec66b97edb2957508152f32e77a1b181afc.zip
keybinds: fixup xkb_states for resolve_by_sym
fixes #7750
Diffstat (limited to 'src/devices/IKeyboard.cpp')
-rw-r--r--src/devices/IKeyboard.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/devices/IKeyboard.cpp b/src/devices/IKeyboard.cpp
index 13440169..3300f252 100644
--- a/src/devices/IKeyboard.cpp
+++ b/src/devices/IKeyboard.cpp
@@ -178,13 +178,18 @@ void IKeyboard::updateXKBTranslationState(xkb_keymap* const keymap) {
if (xkbState)
xkb_state_unref(xkbState);
+ if (xkbSymState)
+ xkb_state_unref(xkbSymState);
+
xkbState = nullptr;
xkbStaticState = nullptr;
+ xkbSymState = nullptr;
if (keymap) {
Debug::log(LOG, "Updating keyboard {:x}'s translation state from a provided keymap", (uintptr_t)this);
xkbStaticState = xkb_state_new(keymap);
xkbState = xkb_state_new(keymap);
+ xkbSymState = xkb_state_new(keymap);
return;
}
@@ -230,6 +235,7 @@ void IKeyboard::updateXKBTranslationState(xkb_keymap* const keymap) {
xkbState = xkb_state_new(KEYMAP);
xkbStaticState = xkb_state_new(KEYMAP);
+ xkbSymState = xkb_state_new(KEYMAP);
xkb_keymap_unref(KEYMAP);
xkb_context_unref(PCONTEXT);
@@ -252,6 +258,7 @@ void IKeyboard::updateXKBTranslationState(xkb_keymap* const keymap) {
xkbState = xkb_state_new(NEWKEYMAP);
xkbStaticState = xkb_state_new(NEWKEYMAP);
+ xkbSymState = xkb_state_new(NEWKEYMAP);
xkb_keymap_unref(NEWKEYMAP);
xkb_context_unref(PCONTEXT);
@@ -332,6 +339,9 @@ void IKeyboard::updateModifiers(uint32_t depressed, uint32_t latched, uint32_t l
xkb_state_update_mask(xkbState, depressed, latched, locked, 0, 0, group);
+ if (xkbSymState)
+ xkb_state_update_mask(xkbSymState, 0, 0, 0, 0, 0, group);
+
if (!updateModifiersState())
return;