mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
Fix tabbed/stacked corner case #742
Tabbed/stacked containers are now created only if a view is present on the workspace. If a view is created on previously empty tabbed/stacked workspace, it gets wrapped in a container.
This commit is contained in:
parent
378149b59c
commit
ee67cd0ba1
4 changed files with 22 additions and 3 deletions
|
|
@ -318,6 +318,16 @@ 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->type == C_WORKSPACE && 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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue