summaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c
index 2a1f0310..2c2cc025 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -519,3 +519,30 @@ void free_sway_binding(struct sway_binding *binding) {
519 } 519 }
520 free(binding); 520 free(binding);
521} 521}
522
523int sway_mouse_binding_cmp_buttons(const void *a, const void *b) {
524 const struct sway_mouse_binding *binda = a, *bindb = b;
525 if (binda->button > bindb->button) {
526 return 1;
527 }
528 if (binda->button < bindb->button) {
529 return -1;
530 }
531 return 0;
532}
533
534int sway_mouse_binding_cmp(const void *a, const void *b) {
535 int cmp = 0;
536 if ((cmp = sway_binding_cmp_keys(a, b)) != 0) {
537 return cmp;
538 }
539 const struct sway_mouse_binding *binda = a, *bindb = b;
540 return lenient_strcmp(binda->command, bindb->command);
541}
542
543void free_sway_mouse_binding(struct sway_mouse_binding *binding) {
544 if (binding->command) {
545 free(binding->command);
546 }
547 free(binding);
548}