mirror of
https://github.com/swaywm/sway.git
synced 2024-12-26 23:18:26 +01:00
Check for empty ws on view destroyed.
In some cases destroying a view can result in an empty and inactive workspace, which should be destroyed. This handles those cases.
This commit is contained in:
parent
ee32bc3aef
commit
c9d9dd7516
1 changed files with 10 additions and 0 deletions
|
@ -303,6 +303,16 @@ static void handle_view_destroyed(wlc_handle handle) {
|
|||
if (fullscreen) {
|
||||
parent->fullscreen = NULL;
|
||||
}
|
||||
|
||||
// Destroy empty workspaces
|
||||
if (parent->type == C_WORKSPACE &&
|
||||
parent->children->length == 0 &&
|
||||
parent->floating->length == 0 &&
|
||||
swayc_active_workspace() != parent &&
|
||||
!parent->visible) {
|
||||
parent = destroy_workspace(parent);
|
||||
}
|
||||
|
||||
arrange_windows(parent, -1, -1);
|
||||
} else {
|
||||
// Is it unmanaged?
|
||||
|
|
Loading…
Reference in a new issue