]> git.sur5r.net Git - i3/i3/commitdiff
randr.c: Fix regression with focusing NULL container 3524/head
authorOrestis Floros <orestisf1993@gmail.com>
Thu, 15 Nov 2018 11:48:14 +0000 (13:48 +0200)
committerOrestis Floros <orestisf1993@gmail.com>
Thu, 15 Nov 2018 11:49:26 +0000 (13:49 +0200)
This was introduced in db3b9e41874400958cf85b461a5d1ff04a398fa3 which
removed the NULL check for next.

Fixes #3523.

src/randr.c

index c0dec7f68c935fb006b46320e540f5f66319e2df..fb127ab5622f1ada69da11b552a8778735972ec9 100644 (file)
@@ -974,10 +974,12 @@ void randr_disable_output(Output *output) {
             }
         }
 
-        /* Restore focus after con_detach / con_attach */
-        DLOG("now focusing next = %p\n", next);
-        con_focus(next);
-        workspace_show(con_get_workspace(next));
+        /* Restore focus after con_detach / con_attach. next can be NULL, see #3523. */
+        if (next) {
+            DLOG("now focusing next = %p\n", next);
+            con_focus(next);
+            workspace_show(con_get_workspace(next));
+        }
 
         /* 3: move the dock clients to the first output */
         Con *child;