Bugfix: Delete empty workspaces even when they’re not the active workspace

This fixes ticket #23
This commit is contained in:
Michael Stapelberg 2009-04-09 11:19:56 +02:00
parent 4bd7667445
commit 72d82f3993
1 changed files with 11 additions and 0 deletions

View 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);
/* Lets see how many clients there are left on the workspace to delete it if its 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);