summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-11-24 19:15:10 +0100
committerLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-11-24 19:26:43 +0100
commita6c9f40b9ab495dea431d9299fa9649ad80a88a7 (patch)
tree5f60434187575272247128958f4d6bcfeb2d72b2 /sway
parentMerge pull request #250 from sce/initial_support_for_criteria_strings (diff)
downloadsway-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).
Diffstat (limited to 'sway')
-rw-r--r--sway/config.c5
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];