correctly store last_split_layout when we are dealing with a workspace-level layout change (Thanks aksr)
fixes #763
This commit is contained in:
parent
f27735f620
commit
afc16953b9
12
src/con.c
12
src/con.c
@ -1062,6 +1062,12 @@ void con_set_border_style(Con *con, int border_style) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void con_set_layout(Con *con, int layout) {
|
void con_set_layout(Con *con, int layout) {
|
||||||
|
/* We fill in last_split_layout when switching to a different layout
|
||||||
|
* since there are many places in the code that don’t use
|
||||||
|
* con_set_layout(). */
|
||||||
|
if (con->layout == L_SPLITH || con->layout == L_SPLITV)
|
||||||
|
con->last_split_layout = con->layout;
|
||||||
|
|
||||||
/* When the container type is CT_WORKSPACE, the user wants to change the
|
/* When the container type is CT_WORKSPACE, the user wants to change the
|
||||||
* whole workspace into stacked/tabbed mode. To do this and still allow
|
* whole workspace into stacked/tabbed mode. To do this and still allow
|
||||||
* intuitive operations (like level-up and then opening a new window), we
|
* intuitive operations (like level-up and then opening a new window), we
|
||||||
@ -1075,6 +1081,7 @@ void con_set_layout(Con *con, int layout) {
|
|||||||
/* 2: Set the requested layout on the split container and mark it as
|
/* 2: Set the requested layout on the split container and mark it as
|
||||||
* split. */
|
* split. */
|
||||||
con_set_layout(new, layout);
|
con_set_layout(new, layout);
|
||||||
|
new->last_split_layout = con->last_split_layout;
|
||||||
new->split = true;
|
new->split = true;
|
||||||
|
|
||||||
Con *old_focused = TAILQ_FIRST(&(con->focus_head));
|
Con *old_focused = TAILQ_FIRST(&(con->focus_head));
|
||||||
@ -1117,11 +1124,6 @@ void con_set_layout(Con *con, int layout) {
|
|||||||
if (con->layout == L_DEFAULT)
|
if (con->layout == L_DEFAULT)
|
||||||
con->layout = L_SPLITH;
|
con->layout = L_SPLITH;
|
||||||
} else {
|
} else {
|
||||||
/* We fill in last_split_layout when switching to a different layout
|
|
||||||
* since there are many places in the code that don’t use
|
|
||||||
* con_set_layout(). */
|
|
||||||
if (con->layout == L_SPLITH || con->layout == L_SPLITV)
|
|
||||||
con->last_split_layout = con->layout;
|
|
||||||
con->layout = layout;
|
con->layout = layout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user