diff options
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sway/container.c b/sway/container.c index e77ba062..2b100f40 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -237,7 +237,7 @@ swayc_t *new_container(swayc_t *child, enum swayc_layouts layout) { | |||
237 | add_child(workspace, cont); | 237 | add_child(workspace, cont); |
238 | // give them proper layouts | 238 | // give them proper layouts |
239 | cont->layout = workspace->layout; | 239 | cont->layout = workspace->layout; |
240 | workspace->layout = layout; | 240 | /* TODO: might break shit in move_container!!! workspace->layout = layout; */ |
241 | set_focused_container_for(workspace, get_focused_view(workspace)); | 241 | set_focused_container_for(workspace, get_focused_view(workspace)); |
242 | } else { // Or is built around container | 242 | } else { // Or is built around container |
243 | swayc_t *parent = replace_child(child, cont); | 243 | swayc_t *parent = replace_child(child, cont); |
@@ -722,9 +722,7 @@ void update_visibility_output(swayc_t *container, wlc_handle output) { | |||
722 | swayc_t *parent = container->parent; | 722 | swayc_t *parent = container->parent; |
723 | container->visible = parent->visible; | 723 | container->visible = parent->visible; |
724 | // special cases where visibility depends on focus | 724 | // special cases where visibility depends on focus |
725 | if (parent->type == C_OUTPUT | 725 | if (parent->type == C_OUTPUT || swayc_is_tabbed_stacked(container)) { |
726 | || parent->layout == L_TABBED | ||
727 | || parent->layout == L_STACKED) { | ||
728 | container->visible = parent->focused == container && parent->visible; | 726 | container->visible = parent->focused == container && parent->visible; |
729 | } | 727 | } |
730 | // Set visibility and output for view | 728 | // Set visibility and output for view |
@@ -814,3 +812,8 @@ static void close_view(swayc_t *container, void *data) { | |||
814 | void close_views(swayc_t *container) { | 812 | void close_views(swayc_t *container) { |
815 | container_map(container, close_view, NULL); | 813 | container_map(container, close_view, NULL); |
816 | } | 814 | } |
815 | |||
816 | bool swayc_is_tabbed_stacked(swayc_t *view) { | ||
817 | return (view->parent->layout == L_TABBED | ||
818 | || view->parent->layout == L_STACKED); | ||
819 | } | ||