summaryrefslogtreecommitdiffstats
path: root/sway/commands/bind.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/bind.c')
-rw-r--r--sway/commands/bind.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 08acbe7a..34881b0f 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -289,13 +289,20 @@ void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding)
289 wlr_log(WLR_DEBUG, "running command for binding: %s", binding->command); 289 wlr_log(WLR_DEBUG, "running command for binding: %s", binding->command);
290 290
291 config->handler_context.seat = seat; 291 config->handler_context.seat = seat;
292 struct cmd_results *results = execute_command(binding->command, NULL, NULL); 292 list_t *res_list = execute_command(binding->command, NULL, NULL);
293 if (results->status == CMD_SUCCESS) { 293 bool success = true;
294 while (res_list->length) {
295 struct cmd_results *results = res_list->items[0];
296 if (results->status != CMD_SUCCESS) {
297 wlr_log(WLR_DEBUG, "could not run command for binding: %s (%s)",
298 binding->command, results->error);
299 success = false;
300 }
301 free_cmd_results(results);
302 list_del(res_list, 0);
303 }
304 list_free(res_list);
305 if (success) {
294 ipc_event_binding(binding); 306 ipc_event_binding(binding);
295 } else {
296 wlr_log(WLR_DEBUG, "could not run command for binding: %s (%s)",
297 binding->command, results->error);
298 } 307 }
299
300 free_cmd_results(results);
301} 308}