summaryrefslogtreecommitdiffstats
path: root/sway/handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 6120e663..24105130 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -341,7 +341,11 @@ static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifier
341 } 341 }
342 if (match) { 342 if (match) {
343 if (state == WLC_KEY_STATE_PRESSED) { 343 if (state == WLC_KEY_STATE_PRESSED) {
344 handle_command(binding->command); 344 struct cmd_results *res = handle_command(binding->command);
345 if (res->status != CMD_SUCCESS) {
346 sway_log(L_ERROR, "Command '%s' failed: %s", res->input, res->error);
347 }
348 free_cmd_results(res);
345 return EVENT_HANDLED; 349 return EVENT_HANDLED;
346 } else if (state == WLC_KEY_STATE_RELEASED) { 350 } else if (state == WLC_KEY_STATE_RELEASED) {
347 // TODO: --released 351 // TODO: --released
@@ -544,8 +548,13 @@ static void handle_wlc_ready(void) {
544 // Execute commands until there are none left 548 // Execute commands until there are none left
545 config->active = true; 549 config->active = true;
546 while (config->cmd_queue->length) { 550 while (config->cmd_queue->length) {
547 handle_command(config->cmd_queue->items[0]); 551 char *line = config->cmd_queue->items[0];
548 free(config->cmd_queue->items[0]); 552 struct cmd_results *res = handle_command(line);
553 if (res->status != CMD_SUCCESS) {
554 sway_log(L_ERROR, "Error on line '%s': %s", line, res->error);
555 }
556 free_cmd_results(res);
557 free(line);
549 list_del(config->cmd_queue, 0); 558 list_del(config->cmd_queue, 0);
550 } 559 }
551} 560}