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).
This commit is contained in:
S. Christoffer Eliesen 2015-11-24 19:15:10 +01:00
parent 8ad8ceeeb9
commit a6c9f40b9a

View file

@ -401,6 +401,11 @@ int sway_binding_cmp_keys(const void *a, const void *b) {
} }
// Otherwise compare keys // 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++) { for (int i = 0; i < binda->keys->length; i++) {
xkb_keysym_t *ka = binda->keys->items[i], xkb_keysym_t *ka = binda->keys->items[i],
*kb = bindb->keys->items[i]; *kb = bindb->keys->items[i];