* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
*
* ipc.c: UNIX domain socket IPC (initialization, client handling, protocol).
*
* when exiting or restarting only!
*
*/
-void ipc_shutdown() {
+void ipc_shutdown(void) {
ipc_client *current;
while (!TAILQ_EMPTY(&all_clients)) {
current = TAILQ_FIRST(&all_clients);
char *command = scalloc(message_size + 1);
strncpy(command, (const char*)message, message_size);
LOG("IPC: received: *%s*\n", command);
- char *reply = parse_cmd((const char*)command);
- char *save_reply = reply;
+ struct CommandResult *command_output = parse_command((const char*)command);
free(command);
+ if (command_output->needs_tree_render)
+ tree_render();
+
/* If no reply was provided, we just use the default success message */
- if (reply == NULL)
- reply = "{\"success\":true}";
- ipc_send_message(fd, strlen(reply), I3_IPC_REPLY_TYPE_COMMAND, (const uint8_t*)reply);
+ ipc_send_message(fd, strlen(command_output->json_output),
+ I3_IPC_REPLY_TYPE_COMMAND,
+ (const uint8_t*)command_output->json_output);
- FREE(save_reply);
+ free(command_output->json_output);
}
static void dump_rect(yajl_gen gen, const char *name, Rect r) {
y(map_open);
ystr("id");
y(integer, con->window->id);
+ ystr("restart_mode");
+ y(bool, true);
y(map_close);
}
}
y(map_open);
YSTR_IF_SET(background);
YSTR_IF_SET(statusline);
- YSTR_IF_SET(focused_workspace_text);
+ YSTR_IF_SET(focused_workspace_border);
YSTR_IF_SET(focused_workspace_bg);
- YSTR_IF_SET(active_workspace_text);
+ YSTR_IF_SET(focused_workspace_text);
+ YSTR_IF_SET(active_workspace_border);
YSTR_IF_SET(active_workspace_bg);
- YSTR_IF_SET(inactive_workspace_text);
+ YSTR_IF_SET(active_workspace_text);
+ YSTR_IF_SET(inactive_workspace_border);
YSTR_IF_SET(inactive_workspace_bg);
- YSTR_IF_SET(urgent_workspace_text);
+ YSTR_IF_SET(inactive_workspace_text);
+ YSTR_IF_SET(urgent_workspace_border);
YSTR_IF_SET(urgent_workspace_bg);
+ YSTR_IF_SET(urgent_workspace_text);
y(map_close);
#undef YSTR_IF_SET