aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorS. Christoffer Eliesen <christoffer@eliesen.no>2015-11-24 19:15:10 +0100
committerS. Christoffer Eliesen <christoffer@eliesen.no>2015-11-24 19:26:43 +0100
commita6c9f40b9ab495dea431d9299fa9649ad80a88a7 (patch)
tree5f60434187575272247128958f4d6bcfeb2d72b2
parent8ad8ceeeb92ca6609bc40974a8c528b593251566 (diff)
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.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) {
}
// Otherwise compare keys
+ if (binda->modifiers > bindb->modifiers) {
+ return 1;
+ } else if (binda->modifiers < bindb->modifiers) {
+ return -1;
+ }
for (int i = 0; i < binda->keys->length; i++) {
xkb_keysym_t *ka = binda->keys->items[i],
*kb = bindb->keys->items[i];