diff options
Diffstat (limited to 'sway/ipc.c')
-rw-r--r-- | sway/ipc.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -222,10 +222,12 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
222 | case IPC_COMMAND: | 222 | case IPC_COMMAND: |
223 | { | 223 | { |
224 | buf[client->payload_length] = '\0'; | 224 | buf[client->payload_length] = '\0'; |
225 | bool success = handle_command(buf); | 225 | struct cmd_results *results = handle_command(buf); |
226 | char reply[64]; | 226 | const char *json = cmd_results_to_json(results); |
227 | int length = snprintf(reply, sizeof(reply), "{\"success\":%s}", success ? "true" : "false"); | 227 | char reply[256]; |
228 | int length = snprintf(reply, sizeof(reply), "%s", json); | ||
228 | ipc_send_reply(client, reply, (uint32_t) length); | 229 | ipc_send_reply(client, reply, (uint32_t) length); |
230 | free_cmd_results(results); | ||
229 | break; | 231 | break; |
230 | } | 232 | } |
231 | case IPC_GET_WORKSPACES: | 233 | case IPC_GET_WORKSPACES: |