X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fipc.c;h=031ee9ab5d78bea6369b740bdc84f760fb734c99;hb=db33da225842fe8c3be296b48aba6e9d1bbe0c0d;hp=7ec2592bad2968de12d738155908bed6b4df814b;hpb=7d2978ead4c45cc08b6decb98dafae3e4d665497;p=i3%2Fi3 diff --git a/src/ipc.c b/src/ipc.c index 7ec2592b..031ee9ab 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -59,8 +59,10 @@ static bool mkdirp(const char *path) { 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)) @@ -248,7 +250,10 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) { 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"); @@ -279,7 +284,7 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) { 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); @@ -490,7 +495,11 @@ IPC_HANDLER(get_marks) { 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);