From 5257a1268f3b0f0f6ca06f9638b362f311ce3fcb Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 17 Aug 2012 01:53:45 +0200 Subject: [PATCH] =?utf8?q?Bugfix:=20don=E2=80=99t=20change=20tabbed/stacke?= =?utf8?q?d=20cons=20to=20splitv/splith=20layout=20(Thanks=20Merovius)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/randr.c b/src/randr.c index 6971ba97..8b6ba1d9 100644 --- a/src/randr.c +++ b/src/randr.c @@ -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); } } -- 2.39.5