diff options
author | 2016-07-07 21:41:32 -0400 | |
---|---|---|
committer | 2016-07-07 21:41:32 -0400 | |
commit | 0374154749653b5f29b86e255af7b2346bddebe0 (patch) | |
tree | 20a270ed04829763c56c854f7b3978cf4b640e5d /sway/handlers.c | |
parent | Merge pull request #739 from deklov/swaybar-pointer-01 (diff) | |
parent | Fix tabbed/stacked corner case #742 (diff) | |
download | sway-0374154749653b5f29b86e255af7b2346bddebe0.tar.gz sway-0374154749653b5f29b86e255af7b2346bddebe0.tar.zst sway-0374154749653b5f29b86e255af7b2346bddebe0.zip |
Merge pull request #744 from thejan2009/tabbed-stacked-layout-fixes
Fix tabbed/stacked corner case #742
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 8f2f8a21..647f9771 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -318,6 +318,16 @@ static bool handle_view_created(wlc_handle handle) { | |||
318 | if (workspace && workspace->fullscreen) { | 318 | if (workspace && workspace->fullscreen) { |
319 | set_focused_container(workspace->fullscreen); | 319 | set_focused_container(workspace->fullscreen); |
320 | } | 320 | } |
321 | |||
322 | // if parent container is a workspace, newview its only child and | ||
323 | // layout is tabbed/stacked, add a container around newview | ||
324 | swayc_t *parent_container = newview->parent; | ||
325 | if (parent_container->type == C_WORKSPACE && parent_container->children->length == 1 && | ||
326 | (parent_container->layout == L_TABBED || parent_container->layout == L_STACKED)) { | ||
327 | swayc_t *container = new_container(newview, parent_container->layout); | ||
328 | set_focused_container(newview); | ||
329 | arrange_windows(container, -1, -1); | ||
330 | } | ||
321 | } else { | 331 | } else { |
322 | swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT); | 332 | swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT); |
323 | wlc_handle *h = malloc(sizeof(wlc_handle)); | 333 | wlc_handle *h = malloc(sizeof(wlc_handle)); |