]> git.sur5r.net Git - i3/i3/commitdiff
Don't migrate unfocused empty workspaces when disabling output.
authorFernando Tarlá Cardoso Lemos <fernandotcl@gmail.com>
Sat, 28 Jan 2012 01:47:59 +0000 (23:47 -0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 7 Feb 2012 20:45:14 +0000 (20:45 +0000)
This is more similar to what happens when you close the last client
of an unfocused workspace (the workspace gets reaped).

src/randr.c

index ae181a916127066b68b5e81637ce2443c8084771..5f1dad52ff71e796511af7097b73703cdb5595a9 100644 (file)
@@ -764,6 +764,12 @@ void randr_query_outputs() {
                 Con *old_content = output_get_content(output->con);
                 while (!TAILQ_EMPTY(&(old_content->nodes_head))) {
                     current = TAILQ_FIRST(&(old_content->nodes_head));
+                    if (current != next && TAILQ_EMPTY(&(current->focus_head))) {
+                        /* the workspace is empty and not focused, get rid of it */
+                        DLOG("Getting rid of current = %p / %s (empty, unfocused)\n", current, current->name);
+                        tree_close(current, DONT_KILL_WINDOW, false, false);
+                        continue;
+                    }
                     DLOG("Detaching current = %p / %s\n", current, current->name);
                     con_detach(current);
                     DLOG("Re-attaching current = %p / %s\n", current, current->name);