]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: don’t change tabbed/stacked cons to splitv/splith layout (Thanks Merovius)
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 16 Aug 2012 23:53:45 +0000 (01:53 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 16 Aug 2012 23:55:31 +0000 (01:55 +0200)
To automagically do the right thing when rotating monitors with regards
to splith/splitv layout (depending on width/height of the monitor), we
change the orientation of existing workspaces and the first child.

If that first child happens to be a stacked/tabbed con, we cannot change
the layout unconditionally (previously, the orientation was not in the
layout, so we never noticed this problem).

fixes #768

src/randr.c

index 6971ba9778c4396f90992d97c25d352105b760fe..8b6ba1d9ac52a13a1e87423330fc50de038a0710 100644 (file)
@@ -464,7 +464,8 @@ static void output_change_mode(xcb_connection_t *conn, Output *output) {
             workspace->layout = (output->rect.height > output->rect.width) ? L_SPLITV : L_SPLITH;
             DLOG("Setting workspace [%d,%s]'s layout to %d.\n", workspace->num, workspace->name, workspace->layout);
             if ((child = TAILQ_FIRST(&(workspace->nodes_head)))) {
-                child->layout = workspace->layout;
+                if (child->layout == L_SPLITV || child->layout == L_SPLITH)
+                    child->layout = workspace->layout;
                 DLOG("Setting child [%d,%s]'s layout to %d.\n", child->num, child->name, child->layout);
             }
         }