diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-11-27 21:42:09 -0500 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-11-27 21:42:09 -0500 |
commit | 5c6f3d7266ab0c63015715f12c8e15eb144311a2 (patch) | |
tree | 8a30abddb8380fc03d6f8674c469570fbf493327 /sway/tree/view.c | |
parent | Merge pull request #3175 from emersion/rename-gtk-primary-selection (diff) | |
download | sway-5c6f3d7266ab0c63015715f12c8e15eb144311a2.tar.gz sway-5c6f3d7266ab0c63015715f12c8e15eb144311a2.tar.zst sway-5c6f3d7266ab0c63015715f12c8e15eb144311a2.zip |
Change execute_command to return a list of results
This matches i3's behavior of returning a list of results that contain
the result of each command that was executed. Additionally, the
`parse_error` attribute has been added to the IPC JSON reply.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index febba3b9..511c2ecc 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -437,9 +437,14 @@ void view_execute_criteria(struct sway_view *view) { | |||
437 | wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'", | 437 | wlr_log(WLR_DEBUG, "for_window '%s' matches view %p, cmd: '%s'", |
438 | criteria->raw, view, criteria->cmdlist); | 438 | criteria->raw, view, criteria->cmdlist); |
439 | list_add(view->executed_criteria, criteria); | 439 | list_add(view->executed_criteria, criteria); |
440 | struct cmd_results *res = execute_command( | 440 | list_t *res_list = execute_command( |
441 | criteria->cmdlist, NULL, view->container); | 441 | criteria->cmdlist, NULL, view->container); |
442 | free_cmd_results(res); | 442 | while (res_list->length) { |
443 | struct cmd_results *res = res_list->items[0]; | ||
444 | free_cmd_results(res); | ||
445 | list_del(res_list, 0); | ||
446 | } | ||
447 | list_free(res_list); | ||
443 | } | 448 | } |
444 | list_free(criterias); | 449 | list_free(criterias); |
445 | } | 450 | } |