diff options
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sway/config.c b/sway/config.c index d923eea5..ae6a02b1 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -652,15 +652,27 @@ int sway_binding_cmp_keys(const void *a, const void *b) { | |||
652 | } else if (binda->modifiers < bindb->modifiers) { | 652 | } else if (binda->modifiers < bindb->modifiers) { |
653 | return -1; | 653 | return -1; |
654 | } | 654 | } |
655 | struct wlc_modifiers no_mods = { 0, 0 }; | ||
655 | for (int i = 0; i < binda->keys->length; i++) { | 656 | for (int i = 0; i < binda->keys->length; i++) { |
656 | xkb_keysym_t *ka = binda->keys->items[i], | 657 | xkb_keysym_t ka = *(xkb_keysym_t *)binda->keys->items[i], |
657 | *kb = bindb->keys->items[i]; | 658 | kb = *(xkb_keysym_t *)bindb->keys->items[i]; |
658 | if (*ka > *kb) { | 659 | if (binda->bindcode) { |
660 | uint32_t *keycode = binda->keys->items[i]; | ||
661 | ka = wlc_keyboard_get_keysym_for_key(*keycode, &no_mods); | ||
662 | } | ||
663 | |||
664 | if (bindb->bindcode) { | ||
665 | uint32_t *keycode = bindb->keys->items[i]; | ||
666 | kb = wlc_keyboard_get_keysym_for_key(*keycode, &no_mods); | ||
667 | } | ||
668 | |||
669 | if (ka > kb) { | ||
659 | return 1; | 670 | return 1; |
660 | } else if (*ka < *kb) { | 671 | } else if (ka < kb) { |
661 | return -1; | 672 | return -1; |
662 | } | 673 | } |
663 | } | 674 | } |
675 | |||
664 | return 0; | 676 | return 0; |
665 | } | 677 | } |
666 | 678 | ||