diff options
author | Mikkel Oscar Lyderik <[email protected]> | 2016-04-01 13:36:36 +0200 |
---|---|---|
committer | Mikkel Oscar Lyderik <[email protected]> | 2016-04-25 00:00:49 +0200 |
commit | 8d700fe008ccf9f7eb4664e236277c9f30a449fb (patch) | |
tree | fb9f36de0acca621a6995db59c52cf3eb2002770 /sway/container.c | |
parent | ec7ff769c7b4da616ebe6bfd90b70350dd39e166 (diff) |
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.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) { add_child(workspace, cont); // give them proper layouts cont->layout = workspace->layout; - workspace->layout = layout; + /* TODO: might break shit in move_container!!! workspace->layout = layout; */ set_focused_container_for(workspace, get_focused_view(workspace)); } else { // Or is built around container swayc_t *parent = replace_child(child, cont); @@ -722,9 +722,7 @@ void update_visibility_output(swayc_t *container, wlc_handle output) { swayc_t *parent = container->parent; container->visible = parent->visible; // special cases where visibility depends on focus - if (parent->type == C_OUTPUT - || parent->layout == L_TABBED - || parent->layout == L_STACKED) { + if (parent->type == C_OUTPUT || swayc_is_tabbed_stacked(container)) { container->visible = parent->focused == container && parent->visible; } // Set visibility and output for view @@ -814,3 +812,8 @@ static void close_view(swayc_t *container, void *data) { void close_views(swayc_t *container) { container_map(container, close_view, NULL); } + +bool swayc_is_tabbed_stacked(swayc_t *view) { + return (view->parent->layout == L_TABBED + || view->parent->layout == L_STACKED); +} |