Make restart IPC command send a reply once restart completed (!) (#3743)

This is achieved by retaining the IPC connection which is sending the restart
command across the restart.

This is the cleaner fix for https://github.com/i3/go-i3/issues/3

fixes #3565
This commit is contained in:
Michael Stapelberg
2019-07-21 14:52:12 +02:00
committed by GitHub
parent 1eabe1b2b1
commit e4ecc6e4a1
10 changed files with 126 additions and 24 deletions

View File

@ -22,6 +22,10 @@ struct CommandResultIR {
/* The JSON generator to append a reply to (may be NULL). */
yajl_gen json_gen;
/* The IPC client connection which sent this command (may be NULL, e.g. for
key bindings). */
ipc_client *client;
/* The next state to transition to. Passed to the function so that we can
* determine the next state as a result of a function call, like
* cfg_criteria_pop_state() does. */
@ -61,7 +65,7 @@ char *parse_string(const char **walk, bool as_word);
*
* Free the returned CommandResult with command_result_free().
*/
CommandResult *parse_command(const char *input, yajl_gen gen);
CommandResult *parse_command(const char *input, yajl_gen gen, ipc_client *client);
/**
* Frees a CommandResult