Added bar_cmd_bindsym

Defined a sway_mouse_binding for clicks on the swaybar
This commit is contained in:
Yacine Hmito 2015-12-14 23:43:52 +01:00
parent 42a85431ee
commit 87126a9fc2
3 changed files with 81 additions and 1 deletions

View file

@ -519,3 +519,30 @@ void free_sway_binding(struct sway_binding *binding) {
}
free(binding);
}
int sway_mouse_binding_cmp_buttons(const void *a, const void *b) {
const struct sway_mouse_binding *binda = a, *bindb = b;
if (binda->button > bindb->button) {
return 1;
}
if (binda->button < bindb->button) {
return -1;
}
return 0;
}
int sway_mouse_binding_cmp(const void *a, const void *b) {
int cmp = 0;
if ((cmp = sway_binding_cmp_keys(a, b)) != 0) {
return cmp;
}
const struct sway_mouse_binding *binda = a, *bindb = b;
return lenient_strcmp(binda->command, bindb->command);
}
void free_sway_mouse_binding(struct sway_mouse_binding *binding) {
if (binding->command) {
free(binding->command);
}
free(binding);
}