commit c9d9dd75161b8f08aa937b8904f529fa05aa92aa
parent ee32bc3aef5ae7c0b96439bc2e5cd1e32612dafd
Author: Mikkel Oscar Lyderik <mikkeloscar@gmail.com>
Date: Thu, 25 Feb 2016 13:36:25 +0100
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.
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/sway/handlers.c b/sway/handlers.c
@@ -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?