From d6f726283ca2445a9c24065db2b57767cba37371 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 12 Mar 2010 15:29:44 +0100 Subject: [PATCH] ipc: also send a reply for COMMAND messages --- include/i3/ipc.h | 3 +++ src/ipc.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/include/i3/ipc.h b/include/i3/ipc.h index 131c4b16..19d93298 100644 --- a/include/i3/ipc.h +++ b/include/i3/ipc.h @@ -34,6 +34,9 @@ * */ +/** Command reply type */ +#define I3_IPC_REPLY_TYPE_COMMAND 0 + /** Workspaces reply type */ #define I3_IPC_REPLY_TYPE_WORKSPACES 1 diff --git a/src/ipc.c b/src/ipc.c index 629ec89d..8bae4f07 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -181,6 +181,12 @@ static void ipc_handle_message(int fd, uint8_t *message, int size, parse_command(global_conn, (const char*)command); free(command); + /* For now, every command gets a positive acknowledge + * (will change with the new command parser) */ + const char *reply = "{\"success\":true}"; + ipc_send_message(fd, (const unsigned char*)reply, + I3_IPC_REPLY_TYPE_COMMAND, strlen(reply)); + break; } case I3_IPC_MESSAGE_TYPE_GET_WORKSPACES: -- 2.39.5