diff options
author | 2016-04-02 16:29:31 +0200 | |
---|---|---|
committer | 2016-04-25 00:00:49 +0200 | |
commit | e226b20bd8d2ce98077aee35b2a33b73943db247 (patch) | |
tree | 6f6d9c1c9743a2cb3d4a0ab013e312bba63d471d /sway/container.c | |
parent | Improve move command with tabbed/stacked layout (diff) | |
download | sway-e226b20bd8d2ce98077aee35b2a33b73943db247.tar.gz sway-e226b20bd8d2ce98077aee35b2a33b73943db247.tar.zst sway-e226b20bd8d2ce98077aee35b2a33b73943db247.zip |
Reapply prev layout when exiting tabbed/stacked
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/container.c b/sway/container.c index 5579fddb..42f6a69a 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -163,6 +163,7 @@ swayc_t *new_workspace(swayc_t *output, const char *name) { | |||
163 | sway_log(L_DEBUG, "Added workspace %s for output %u", name, (unsigned int)output->handle); | 163 | sway_log(L_DEBUG, "Added workspace %s for output %u", name, (unsigned int)output->handle); |
164 | swayc_t *workspace = new_swayc(C_WORKSPACE); | 164 | swayc_t *workspace = new_swayc(C_WORKSPACE); |
165 | 165 | ||
166 | workspace->prev_layout = L_NONE; | ||
166 | workspace->layout = default_layout(output); | 167 | workspace->layout = default_layout(output); |
167 | 168 | ||
168 | workspace->x = output->x; | 169 | workspace->x = output->x; |
@@ -203,6 +204,7 @@ swayc_t *new_container(swayc_t *child, enum swayc_layouts layout) { | |||
203 | 204 | ||
204 | sway_log(L_DEBUG, "creating container %p around %p", cont, child); | 205 | sway_log(L_DEBUG, "creating container %p around %p", cont, child); |
205 | 206 | ||
207 | cont->prev_layout = L_NONE; | ||
206 | cont->layout = layout; | 208 | cont->layout = layout; |
207 | cont->width = child->width; | 209 | cont->width = child->width; |
208 | cont->height = child->height; | 210 | cont->height = child->height; |
@@ -229,6 +231,7 @@ swayc_t *new_container(swayc_t *child, enum swayc_layouts layout) { | |||
229 | add_child(workspace, cont); | 231 | add_child(workspace, cont); |
230 | // give them proper layouts | 232 | // give them proper layouts |
231 | cont->layout = workspace->layout; | 233 | cont->layout = workspace->layout; |
234 | cont->prev_layout = workspace->prev_layout; | ||
232 | /* TODO: might break shit in move_container!!! workspace->layout = layout; */ | 235 | /* TODO: might break shit in move_container!!! workspace->layout = layout; */ |
233 | set_focused_container_for(workspace, get_focused_view(workspace)); | 236 | set_focused_container_for(workspace, get_focused_view(workspace)); |
234 | } else { // Or is built around container | 237 | } else { // Or is built around container |