mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-28 22:23:42 +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) {
|
if (fullscreen) {
|
||||||
parent->fullscreen = NULL;
|
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);
|
arrange_windows(parent, -1, -1);
|
||||||
} else {
|
} else {
|
||||||
// Is it unmanaged?
|
// Is it unmanaged?
|
||||||
|
|
Loading…
Reference in a new issue