]> git.sur5r.net Git - i3/i3/commitdiff
ipc: also send a reply for COMMAND messages
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 12 Mar 2010 14:29:44 +0000 (15:29 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 12 Mar 2010 14:29:44 +0000 (15:29 +0100)
include/i3/ipc.h
src/ipc.c

index 131c4b167aafc966b7a1d0aa62843597a26e44df..19d932981fa9304b8a878277a8f10b3bc796c8d3 100644 (file)
@@ -34,6 +34,9 @@
  *
  */
 
+/** Command reply type */
+#define I3_IPC_REPLY_TYPE_COMMAND               0
+
 /** Workspaces reply type */
 #define I3_IPC_REPLY_TYPE_WORKSPACES            1
 
index 629ec89d4624adfb3fc37afa4882e040f9e3438b..8bae4f07c330762778e1cd839e08fa28c6508c90 100644 (file)
--- 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: