From: Helgi Kristvin Sigurbjarnarson Date: Sun, 7 Aug 2011 16:42:23 +0000 (+0000) Subject: Preserve marks between restarts. X-Git-Tag: 4.1~230^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3cc22dcbe405c4b5c5d5f2cb04a8b7dc74961990;p=i3%2Fi3 Preserve marks between restarts. --- diff --git a/src/ipc.c b/src/ipc.c index 9ad89cbb..a83e5fe4 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -200,6 +200,11 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) { ystr("urgent"); y(bool, con->urgent); + if (con->mark != NULL) { + ystr("mark"); + ystr(con->mark); + } + ystr("focused"); y(bool, (con == focused)); diff --git a/src/load_layout.c b/src/load_layout.c index b61a0e5c..37322c4e 100644 --- a/src/load_layout.c +++ b/src/load_layout.c @@ -146,6 +146,10 @@ static int json_string(void *ctx, const unsigned char *val, unsigned int len) { json_node->layout = L_OUTPUT; else LOG("Unhandled \"layout\": %s\n", buf); free(buf); + } else if (strcasecmp(last_key, "mark") == 0) { + char *buf = NULL; + asprintf(&buf, "%.*s", (int)len, val); + json_node->mark = buf; } } return 1;