]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Fix crash on new clients (Thanks Mirko)
authorMichael Stapelberg <michael+git@stapelberg.de>
Sun, 3 May 2009 20:18:33 +0000 (22:18 +0200)
committerMichael Stapelberg <michael+git@stapelberg.de>
Sun, 3 May 2009 20:18:33 +0000 (22:18 +0200)
src/util.c

index 1a8b7ac4af4eb5e7393944954fb09a8b0cd9de90..c3e45c51d7642eb2561cdf55fa14f9e59e59f981 100644 (file)
@@ -300,9 +300,11 @@ void set_focus(xcb_connection_t *conn, Client *client, bool set_anyways) {
                  * we might have just gone into stacking mode and need to raise */
                 Client *last_focused = get_last_focused_client(conn, client->container, client);
 
-                LOG("raising above frame %p / child %p\n", last_focused->frame, last_focused->child);
-                uint32_t values[] = { last_focused->frame, XCB_STACK_MODE_ABOVE };
-                xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
+                if (last_focused != NULL) {
+                        LOG("raising above frame %p / child %p\n", last_focused->frame, last_focused->child);
+                        uint32_t values[] = { last_focused->frame, XCB_STACK_MODE_ABOVE };
+                        xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
+                }
         }
 
         /* If it is the same one as old_client, we save us the unnecessary redecorate */