]> git.sur5r.net Git - i3/i3/commitdiff
Don't mess with the focus if we're not killing.
authorFernando Tarlá Cardoso Lemos <fernandotcl@gmail.com>
Thu, 27 Jan 2011 23:09:48 +0000 (21:09 -0200)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 28 Jan 2011 00:25:03 +0000 (01:25 +0100)
If we're not killing the mapped window and we're not killing the
parent window either in tree_close, then there's no reason to try
to change the focus. This fixes focus issues when moving a
container around another container (move up, left, bottom, right).

src/tree.c

index aa79587ba64762940f24e58164f4835cad2c5c26..9a2aab96e769db44b60f5f5eba4858e9ef64b00e 100644 (file)
@@ -177,9 +177,14 @@ void tree_close(Con *con, bool kill_window, bool dont_kill_parent) {
     }
 
     if (was_mapped || con == focused) {
-        DLOG("focusing %p / %s\n", next, next->name);
-        /* TODO: check if the container (or one of its children) was focused */
-        con_focus(next);
+        if (kill_window || !dont_kill_parent) {
+            DLOG("focusing %p / %s\n", next, next->name);
+            /* TODO: check if the container (or one of its children) was focused */
+            con_focus(next);
+        }
+        else {
+            DLOG("not focusing because we're not killing anybody");
+        }
     } else {
         DLOG("not focusing, was not mapped\n");
     }