]> git.sur5r.net Git - i3/i3/commitdiff
Preserve marks between restarts.
authorHelgi Kristvin Sigurbjarnarson <helgikrs@gmail.com>
Sun, 7 Aug 2011 16:42:23 +0000 (16:42 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 9 Aug 2011 06:19:31 +0000 (08:19 +0200)
src/ipc.c
src/load_layout.c

index 9ad89cbbf26e33fd5bdff6df94bb7feb6721254d..a83e5fe4041ccfc58a234903600860107b46a5cd 100644 (file)
--- 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));
 
index b61a0e5c490210a72d30255ebef30ed576469c4c..37322c4ea3857f2b92e85f05c5ee843054f8e975 100644 (file)
@@ -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;