From 4cba91803eb8c3c3ab4ebf22e94510b43f7a907d Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 12 Oct 2016 21:26:06 -0400 Subject: Revert "Fixes dealing with workspace_layout and related bugs [rfc]" --- sway/handlers.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sway/handlers.c') diff --git a/sway/handlers.c b/sway/handlers.c index 9a84182a..2235bc8b 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -398,6 +398,17 @@ static bool handle_view_created(wlc_handle handle) { if (workspace && workspace->fullscreen) { set_focused_container(workspace->fullscreen); } + + // if parent container is a workspace, newview its only child and + // layout is tabbed/stacked, add a container around newview + swayc_t *parent_container = newview->parent; + if (parent_container && parent_container->type == C_WORKSPACE && + parent_container->children && parent_container->children->length == 1 && + (parent_container->layout == L_TABBED || parent_container->layout == L_STACKED)) { + swayc_t *container = new_container(newview, parent_container->layout); + set_focused_container(newview); + arrange_windows(container, -1, -1); + } } else { swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT); wlc_handle *h = malloc(sizeof(wlc_handle)); -- cgit v1.2.3