summaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 93c74915..b1b1c5b6 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -220,7 +220,7 @@ static struct cmd_results *cmd_bindsym(int argc, char **argv) {
220 } 220 }
221 binding->order = binding_order++; 221 binding->order = binding_order++;
222 list_add(mode->bindings, binding); 222 list_add(mode->bindings, binding);
223 list_sort(mode->bindings, sway_binding_cmp); 223 list_qsort(mode->bindings, sway_binding_cmp_qsort);
224 224
225 sway_log(L_DEBUG, "bindsym - Bound %s to command %s", argv[0], binding->command); 225 sway_log(L_DEBUG, "bindsym - Bound %s to command %s", argv[0], binding->command);
226 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 226 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
@@ -1266,9 +1266,9 @@ static struct cmd_results *cmd_scratchpad(int argc, char **argv) {
1266} 1266}
1267 1267
1268// sort in order of longest->shortest 1268// sort in order of longest->shortest
1269static int compare_set(const void *_l, const void *_r) { 1269static int compare_set_qsort(const void *_l, const void *_r) {
1270 struct sway_variable const *l = _l; 1270 struct sway_variable const *l = *(void **)_l;
1271 struct sway_variable const *r = _r; 1271 struct sway_variable const *r = *(void **)_r;
1272 return strlen(r->name) - strlen(l->name); 1272 return strlen(r->name) - strlen(l->name);
1273} 1273}
1274 1274
@@ -1295,7 +1295,7 @@ static struct cmd_results *cmd_set(int argc, char **argv) {
1295 var = malloc(sizeof(struct sway_variable)); 1295 var = malloc(sizeof(struct sway_variable));
1296 var->name = strdup(argv[0]); 1296 var->name = strdup(argv[0]);
1297 list_add(config->symbols, var); 1297 list_add(config->symbols, var);
1298 list_sort(config->symbols, compare_set); 1298 list_qsort(config->symbols, compare_set_qsort);
1299 } 1299 }
1300 var->value = join_args(argv + 1, argc - 1); 1300 var->value = join_args(argv + 1, argc - 1);
1301 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 1301 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
@@ -1631,7 +1631,7 @@ static struct cmd_results *bar_cmd_bindsym(int argc, char **argv) {
1631 list_del(bar->bindings, i); 1631 list_del(bar->bindings, i);
1632 } 1632 }
1633 list_add(bar->bindings, binding); 1633 list_add(bar->bindings, binding);
1634 list_sort(bar->bindings, sway_mouse_binding_cmp); 1634 list_qsort(bar->bindings, sway_mouse_binding_cmp_qsort);
1635 1635
1636 sway_log(L_DEBUG, "bindsym - Bound %s to command %s when clicking swaybar", argv[0], binding->command); 1636 sway_log(L_DEBUG, "bindsym - Bound %s to command %s when clicking swaybar", argv[0], binding->command);
1637 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 1637 return cmd_results_new(CMD_SUCCESS, NULL, NULL);