aboutsummaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-04-01 13:36:36 +0200
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-04-25 00:00:49 +0200
commit8d700fe008ccf9f7eb4664e236277c9f30a449fb (patch)
treefb9f36de0acca621a6995db59c52cf3eb2002770 /sway/container.c
parentTabbed and stacked layout (diff)
downloadsway-8d700fe008ccf9f7eb4664e236277c9f30a449fb.tar.gz
sway-8d700fe008ccf9f7eb4664e236277c9f30a449fb.tar.zst
sway-8d700fe008ccf9f7eb4664e236277c9f30a449fb.zip
Fix problems with floating windows
Makes any tabbed/stacked layout a container to separate from floating windows which may be attached to a workspace.
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c11
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) {
814void close_views(swayc_t *container) { 812void close_views(swayc_t *container) {
815 container_map(container, close_view, NULL); 813 container_map(container, close_view, NULL);
816} 814}
815
816bool swayc_is_tabbed_stacked(swayc_t *view) {
817 return (view->parent->layout == L_TABBED
818 || view->parent->layout == L_STACKED);
819}