diff options
author | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-11-24 19:15:10 +0100 |
---|---|---|
committer | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-11-24 19:26:43 +0100 |
commit | a6c9f40b9ab495dea431d9299fa9649ad80a88a7 (patch) | |
tree | 5f60434187575272247128958f4d6bcfeb2d72b2 | |
parent | Merge pull request #250 from sce/initial_support_for_criteria_strings (diff) | |
download | sway-a6c9f40b9ab495dea431d9299fa9649ad80a88a7.tar.gz sway-a6c9f40b9ab495dea431d9299fa9649ad80a88a7.tar.zst sway-a6c9f40b9ab495dea431d9299fa9649ad80a88a7.zip |
sway_binding_cmp_keys: Differentiate between modifier keys.
Compare modifiers as well as keys when number of modifiers+keys are the
same (so that e.g. mod1+x != mod4+x).
-rw-r--r-- | sway/config.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c index f2523c1f..13865058 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -401,6 +401,11 @@ int sway_binding_cmp_keys(const void *a, const void *b) { | |||
401 | } | 401 | } |
402 | 402 | ||
403 | // Otherwise compare keys | 403 | // Otherwise compare keys |
404 | if (binda->modifiers > bindb->modifiers) { | ||
405 | return 1; | ||
406 | } else if (binda->modifiers < bindb->modifiers) { | ||
407 | return -1; | ||
408 | } | ||
404 | for (int i = 0; i < binda->keys->length; i++) { | 409 | for (int i = 0; i < binda->keys->length; i++) { |
405 | xkb_keysym_t *ka = binda->keys->items[i], | 410 | xkb_keysym_t *ka = binda->keys->items[i], |
406 | *kb = bindb->keys->items[i]; | 411 | *kb = bindb->keys->items[i]; |