]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Delete empty workspaces even when they’re not the active workspace
authorMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 9 Apr 2009 09:19:56 +0000 (11:19 +0200)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 9 Apr 2009 09:19:56 +0000 (11:19 +0200)
This fixes ticket #23

src/handlers.c

index e5835184a03a858fc02b9049f8f0627e0a66c20a..deb13b22626c979205879562cee6db1a5d413680 100644 (file)
@@ -635,6 +635,17 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
         if (client->container != NULL)
                 cleanup_table(conn, client->container->workspace);
 
+        /* Let’s see how many clients there are left on the workspace to delete it if it’s empty */
+        bool workspace_empty = true;
+        FOR_TABLE(client->workspace)
+                if (!CIRCLEQ_EMPTY(&(client->workspace->table[cols][rows]->clients))) {
+                        workspace_empty = false;
+                        break;
+                }
+
+        if (workspace_empty)
+                client->workspace->screen = NULL;
+
         free(client);
 
         render_layout(conn);