commit a6c9f40b9ab495dea431d9299fa9649ad80a88a7
parent 8ad8ceeeb92ca6609bc40974a8c528b593251566
Author: S. Christoffer Eliesen <christoffer@eliesen.no>
Date: Tue, 24 Nov 2015 19:15:10 +0100
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:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git 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];