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 3d882a7b..f6d9b947 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -219,7 +219,7 @@ static struct cmd_results *cmd_bindsym(int argc, char **argv) {
219 } 219 }
220 binding->order = binding_order++; 220 binding->order = binding_order++;
221 list_add(mode->bindings, binding); 221 list_add(mode->bindings, binding);
222 list_sort(mode->bindings, sway_binding_cmp); 222 list_qsort(mode->bindings, sway_binding_cmp_qsort);
223 223
224 sway_log(L_DEBUG, "bindsym - Bound %s to command %s", argv[0], binding->command); 224 sway_log(L_DEBUG, "bindsym - Bound %s to command %s", argv[0], binding->command);
225 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 225 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
@@ -1255,9 +1255,9 @@ static struct cmd_results *cmd_scratchpad(int argc, char **argv) {
1255} 1255}
1256 1256
1257// sort in order of longest->shortest 1257// sort in order of longest->shortest
1258static int compare_set(const void *_l, const void *_r) { 1258static int compare_set_qsort(const void *_l, const void *_r) {
1259 struct sway_variable const *l = _l; 1259 struct sway_variable const *l = *(void **)_l;
1260 struct sway_variable const *r = _r; 1260 struct sway_variable const *r = *(void **)_r;
1261 return strlen(r->name) - strlen(l->name); 1261 return strlen(r->name) - strlen(l->name);
1262} 1262}
1263 1263
@@ -1284,7 +1284,7 @@ static struct cmd_results *cmd_set(int argc, char **argv) {
1284 var = malloc(sizeof(struct sway_variable)); 1284 var = malloc(sizeof(struct sway_variable));
1285 var->name = strdup(argv[0]); 1285 var->name = strdup(argv[0]);
1286 list_add(config->symbols, var); 1286 list_add(config->symbols, var);
1287 list_sort(config->symbols, compare_set); 1287 list_qsort(config->symbols, compare_set_qsort);
1288 } 1288 }
1289 var->value = join_args(argv + 1, argc - 1); 1289 var->value = join_args(argv + 1, argc - 1);
1290 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 1290 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
@@ -1620,7 +1620,7 @@ static struct cmd_results *bar_cmd_bindsym(int argc, char **argv) {
1620 list_del(bar->bindings, i); 1620 list_del(bar->bindings, i);
1621 } 1621 }
1622 list_add(bar->bindings, binding); 1622 list_add(bar->bindings, binding);
1623 list_sort(bar->bindings, sway_mouse_binding_cmp); 1623 list_qsort(bar->bindings, sway_mouse_binding_cmp_qsort);
1624 1624
1625 sway_log(L_DEBUG, "bindsym - Bound %s to command %s when clicking swaybar", argv[0], binding->command); 1625 sway_log(L_DEBUG, "bindsym - Bound %s to command %s when clicking swaybar", argv[0], binding->command);
1626 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 1626 return cmd_results_new(CMD_SUCCESS, NULL, NULL);