summaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authorYacine Hmito <[email protected]>2015-12-14 23:43:52 +0100
committerYacine Hmito <[email protected]>2015-12-15 00:15:32 +0100
commit87126a9fc2306f8e15e6148ccdc021517c414114 (patch)
tree9b81f04d730f5ee0f5e7323517c0e31164cc0cf8 /sway/config.c
parent42a85431eec1472e18cf886e02a629cda46f8123 (diff)
Added bar_cmd_bindsym
Defined a sway_mouse_binding for clicks on the swaybar
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) {
}
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);
+}