copy[strlen(copy)-1] = '\0';
char *sep = strrchr(copy, '/');
- if (sep == NULL)
+ if (sep == NULL) {
+ FREE(copy);
return false;
+ }
*sep = '\0';
bool result = false;
if (mkdirp(copy))
dump_rect(gen, "geometry", con->geometry);
ystr("name");
- ystr(con->name);
+ if (con->window && con->window->name_json)
+ ystr(con->window->name_json);
+ else
+ ystr(con->name);
if (con->type == CT_WORKSPACE) {
ystr("num");
ystr("focus");
y(array_open);
- TAILQ_FOREACH(node, &(con->focus_head), nodes) {
+ TAILQ_FOREACH(node, &(con->focus_head), focused) {
y(integer, (long int)node);
}
y(array_close);
y(array_close);
const unsigned char *payload;
+#if YAJL_MAJOR >= 2
+ size_t length;
+#else
unsigned int length;
+#endif
y(get_buf, &payload, &length);
ipc_send_message(fd, payload, I3_IPC_REPLY_TYPE_MARKS, length);
ev_io_init(package, ipc_receive_message, client, EV_READ);
ev_io_start(EV_A_ package);
- DLOG("IPC: new client connected\n");
+ DLOG("IPC: new client connected on fd %d\n", w->fd);
ipc_client *new = scalloc(sizeof(ipc_client));
new->fd = client;