i3 - improved tiling WM


Bugfix: don't focus unmapped container on manage

Patch status: needinfo

Patch by Tony Crisci

Long description:

A window may become unmapped on manage when an assignment command unmaps
the window, such as moving it to the scratchpad or killing it.

fixes #1283

To apply this patch, use:
curl http://cr.i3wm.org/patch/604/raw.patch | git am

b/src/manage.c

17
@@ -505,7 +505,7 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
18
 
19
     /* Defer setting focus after the 'new' event has been sent to ensure the
20
      * proper window event sequence. */
21
-    if (set_focus && !nc->window->doesnt_accept_focus) {
22
+    if (set_focus && !nc->window->doesnt_accept_focus && nc->mapped) {
23
         DLOG("Now setting focus.\n");
24
         con_focus(nc);
25
     }