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.
master
Mikkel Oscar Lyderik 9 years ago
parent ee32bc3aef
commit c9d9dd7516

@ -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…
Cancel
Save