]> git.sur5r.net Git - i3/i3/blobdiff - src/workspace.c
Allow changing the layout of workspaces by storing it (Thanks mhcerri)
[i3/i3] / src / workspace.c
index 1749959aa20c9c416fa8dde3b57b1235a43ef67d..94efd47b6e2455cf0151f7a41b0366d9022aeed8 100644 (file)
@@ -73,6 +73,7 @@ Con *workspace_get(const char *num, bool *created) {
         workspace->type = CT_WORKSPACE;
         FREE(workspace->name);
         workspace->name = sstrdup(num);
+        workspace->workspace_layout = config.default_layout;
         /* We set ->num to the number if this workspace’s name begins with a
          * positive number. Otherwise it’s a named ws and num will be -1. */
         char *endptr = NULL;
@@ -742,7 +743,7 @@ void ws_force_orientation(Con *ws, orientation_t orientation) {
 Con *workspace_attach_to(Con *ws) {
     DLOG("Attaching a window to workspace %p / %s\n", ws, ws->name);
 
-    if (config.default_layout == L_DEFAULT) {
+    if (ws->workspace_layout == L_DEFAULT) {
         DLOG("Default layout, just attaching it to the workspace itself.\n");
         return ws;
     }
@@ -754,7 +755,7 @@ Con *workspace_attach_to(Con *ws) {
     new->split = true;
 
     /* 2: set the requested layout on the split con */
-    new->layout = config.default_layout;
+    new->layout = ws->workspace_layout;
 
     /* 4: attach the new split container to the workspace */
     DLOG("Attaching new split %p to workspace %p\n", new, ws);