diff options
author | M Stoeckl <code@mstoeckl.com> | 2019-01-10 08:27:52 -0500 |
---|---|---|
committer | M Stoeckl <code@mstoeckl.com> | 2019-01-14 07:58:02 -0500 |
commit | 6d392150a72ecc3b69fcfb48865f625e2c7b79d6 (patch) | |
tree | d475f79c414825f4f3eb6ab0e2d2e28d929f7e71 /sway/config.c | |
parent | Merge pull request #3418 from RyanDwyer/remove-resize-axis (diff) | |
download | sway-6d392150a72ecc3b69fcfb48865f625e2c7b79d6.tar.gz sway-6d392150a72ecc3b69fcfb48865f625e2c7b79d6.tar.zst sway-6d392150a72ecc3b69fcfb48865f625e2c7b79d6.zip |
Remove 'input' field of IPC command return json
This field is not in i3 and provides imprecise and redundant information.
(Specifically, when swaymsg is given a list of commands, the IPC return
array already indicates precisely which number command failed; knowing
the name of the command is not useful when multiple commands of the
same type are provided.)
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/config.c b/sway/config.c index 18fee404..d5d36306 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -710,11 +710,12 @@ bool read_config(FILE *file, struct sway_config *config, | |||
710 | config->current_config_line_number = line_number; | 710 | config->current_config_line_number = line_number; |
711 | config->current_config_line = line; | 711 | config->current_config_line = line; |
712 | struct cmd_results *res; | 712 | struct cmd_results *res; |
713 | char *new_block = NULL; | ||
713 | if (block && strcmp(block, "<commands>") == 0) { | 714 | if (block && strcmp(block, "<commands>") == 0) { |
714 | // Special case | 715 | // Special case |
715 | res = config_commands_command(expanded); | 716 | res = config_commands_command(expanded); |
716 | } else { | 717 | } else { |
717 | res = config_command(expanded); | 718 | res = config_command(expanded, &new_block); |
718 | } | 719 | } |
719 | switch(res->status) { | 720 | switch(res->status) { |
720 | case CMD_FAILURE: | 721 | case CMD_FAILURE: |
@@ -740,9 +741,9 @@ bool read_config(FILE *file, struct sway_config *config, | |||
740 | break; | 741 | break; |
741 | 742 | ||
742 | case CMD_BLOCK: | 743 | case CMD_BLOCK: |
743 | wlr_log(WLR_DEBUG, "Entering block '%s'", res->input); | 744 | wlr_log(WLR_DEBUG, "Entering block '%s'", new_block); |
744 | list_insert(stack, 0, strdup(res->input)); | 745 | list_insert(stack, 0, strdup(new_block)); |
745 | if (strcmp(res->input, "bar") == 0) { | 746 | if (strcmp(new_block, "bar") == 0) { |
746 | config->current_bar = NULL; | 747 | config->current_bar = NULL; |
747 | } | 748 | } |
748 | break; | 749 | break; |
@@ -764,6 +765,7 @@ bool read_config(FILE *file, struct sway_config *config, | |||
764 | sizeof(config->handler_context)); | 765 | sizeof(config->handler_context)); |
765 | default:; | 766 | default:; |
766 | } | 767 | } |
768 | free(new_block); | ||
767 | free(expanded); | 769 | free(expanded); |
768 | free_cmd_results(res); | 770 | free_cmd_results(res); |
769 | } | 771 | } |