static bool parsing_window_rect;
static bool parsing_geometry;
static bool parsing_focus;
+static bool parsing_marks;
struct Match *current_swallow;
/* This list is used for reordering the focus stack after parsing the 'focus'
static int json_end_array(void *ctx) {
LOG("end of array\n");
- if (!parsing_swallows && !parsing_focus) {
+ if (!parsing_swallows && !parsing_focus && !parsing_marks) {
con_fix_percent(json_node);
}
if (parsing_swallows) {
parsing_swallows = false;
}
+ if (parsing_marks) {
+ parsing_marks = false;
+ }
+
if (parsing_focus) {
/* Clear the list of focus mappings */
struct focus_mapping *mapping;
if (strcasecmp(last_key, "focus") == 0)
parsing_focus = true;
+ if (strcasecmp(last_key, "marks") == 0)
+ parsing_marks = true;
+
return 1;
}
ELOG("swallow key %s unknown\n", last_key);
}
free(sval);
+ } else if (parsing_marks) {
+ char *mark;
+ sasprintf(&mark, "%.*s", (int)len, val);
+
+ con_mark(json_node, mark, MM_ADD);
} else {
if (strcasecmp(last_key, "name") == 0) {
json_node->name = scalloc(len + 1, 1);
LOG("Unhandled \"last_splitlayout\": %s\n", buf);
free(buf);
} else if (strcasecmp(last_key, "mark") == 0) {
+ DLOG("Found deprecated key \"mark\".\n");
+
char *buf = NULL;
sasprintf(&buf, "%.*s", (int)len, val);
- /* We unmark any containers using this mark to avoid duplicates. */
- con_unmark(buf);
-
- json_node->mark = buf;
+ con_mark(json_node, buf, MM_REPLACE);
} else if (strcasecmp(last_key, "floating") == 0) {
char *buf = NULL;
sasprintf(&buf, "%.*s", (int)len, val);
parsing_window_rect = false;
parsing_geometry = false;
parsing_focus = false;
+ parsing_marks = false;
setlocale(LC_NUMERIC, "C");
stat = yajl_parse(hand, (const unsigned char *)buf, n);
if (stat != yajl_status_ok) {