]> git.sur5r.net Git - i3/i3/blobdiff - src/load_layout.c
Introduce parse_direction
[i3/i3] / src / load_layout.c
index 071b3ccd650a1833fbf4efdb4d7d91fe4649dff2..add78875bdcc387b6d8258c42b68a8a4eb389d61 100644 (file)
@@ -108,18 +108,11 @@ static int json_end_map(void *ctx) {
             /* Prevent name clashes when appending a workspace, e.g. when the
              * user tries to restore a workspace called “1” but already has a
              * workspace called “1”. */
-            Con *output;
-            Con *workspace = NULL;
-            TAILQ_FOREACH(output, &(croot->nodes_head), nodes)
-            GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
             char *base = sstrdup(json_node->name);
             int cnt = 1;
-            while (workspace != NULL) {
+            while (get_existing_workspace_by_name(json_node->name) != NULL) {
                 FREE(json_node->name);
                 sasprintf(&(json_node->name), "%s_%d", base, cnt++);
-                workspace = NULL;
-                TAILQ_FOREACH(output, &(croot->nodes_head), nodes)
-                GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
             }
             free(base);
 
@@ -654,6 +647,6 @@ void tree_append_json(Con *con, const char *buf, const size_t len, char **errorm
     yajl_free(hand);
 
     if (to_focus) {
-        con_focus(to_focus);
+        con_activate(to_focus);
     }
 }