aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/bind.c
diff options
context:
space:
mode:
authorLibravatar Konstantin Pospelov <kupospelov@gmail.com>2019-02-19 16:35:35 +0300
committerLibravatar Simon Ser <contact@emersion.fr>2019-04-26 20:56:48 +0300
commitf1609abe4c20a04b0b57f797b0e864b29840eda8 (patch)
treebe675820914ecad26516e7deb49d7bea9dc79d89 /sway/commands/bind.c
parentImplement bindsym --to-code (diff)
downloadsway-f1609abe4c20a04b0b57f797b0e864b29840eda8.tar.gz
sway-f1609abe4c20a04b0b57f797b0e864b29840eda8.tar.zst
sway-f1609abe4c20a04b0b57f797b0e864b29840eda8.zip
config: simplify keysym translation fields
Do not store `xkb_keymap` since it can be retrieved from `xkb_state`.
Diffstat (limited to 'sway/commands/bind.c')
-rw-r--r--sway/commands/bind.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index e5fd4433..ea8179bb 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -604,7 +604,7 @@ struct keycode_matches {
604static void find_keycode(struct xkb_keymap *keymap, 604static void find_keycode(struct xkb_keymap *keymap,
605 xkb_keycode_t keycode, void *data) { 605 xkb_keycode_t keycode, void *data) {
606 xkb_keysym_t keysym = xkb_state_key_get_one_sym( 606 xkb_keysym_t keysym = xkb_state_key_get_one_sym(
607 config->keysym_translation.xkb_state, keycode); 607 config->keysym_translation_state, keycode);
608 608
609 if (keysym == XKB_KEY_NoSymbol) { 609 if (keysym == XKB_KEY_NoSymbol) {
610 return; 610 return;
@@ -627,7 +627,8 @@ static struct keycode_matches get_keycode_for_keysym(xkb_keysym_t keysym) {
627 .count = 0, 627 .count = 0,
628 }; 628 };
629 629
630 xkb_keymap_key_for_each(config->keysym_translation.xkb_keymap, 630 xkb_keymap_key_for_each(
631 xkb_state_get_keymap(config->keysym_translation_state),
631 find_keycode, &matches); 632 find_keycode, &matches);
632 return matches; 633 return matches;
633} 634}