From: Michael Stapelberg Date: Thu, 9 Apr 2009 09:19:56 +0000 (+0200) Subject: Bugfix: Delete empty workspaces even when they’re not the active workspace X-Git-Tag: 3.a-bf1~52 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=72d82f399378f953f9a85916eae23e42c91b52a2;p=i3%2Fi3 Bugfix: Delete empty workspaces even when they’re not the active workspace This fixes ticket #23 --- diff --git a/src/handlers.c b/src/handlers.c index e5835184..deb13b22 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -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);