]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: When rendering, skip containers which are not yet initialized
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 29 Sep 2009 10:26:53 +0000 (12:26 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 29 Sep 2009 10:26:53 +0000 (12:26 +0200)
This is necessary now, because when creating a new row, several
containers have to be created. Since the implementation of the default
mode for containers, this also involves rendering the layout. However,
when rendering the layout, all of the containers are potentially
accessed…

src/layout.c

index fa18bbc107ad14796ec289ad1095f4dc8096ffce..59309c9d78a7a7e530b2c5f906ede02cb8de8c18 100644 (file)
@@ -632,7 +632,10 @@ void ignore_enter_notify_forall(xcb_connection_t *conn, Workspace *workspace, bo
         Client *client;
         uint32_t values[1];
 
-        FOR_TABLE(workspace)
+        FOR_TABLE(workspace) {
+                if (workspace->table[cols][rows] == NULL)
+                        continue;
+
                 CIRCLEQ_FOREACH(client, &(workspace->table[cols][rows]->clients), clients) {
                         /* Change event mask for the decorations */
                         values[0] = FRAME_EVENT_MASK;
@@ -646,6 +649,7 @@ void ignore_enter_notify_forall(xcb_connection_t *conn, Workspace *workspace, bo
                                 values[0] &= ~(XCB_EVENT_MASK_ENTER_WINDOW);
                         xcb_change_window_attributes(conn, client->child, XCB_CW_EVENT_MASK, values);
                 }
+        }
 }
 
 /*
@@ -678,6 +682,8 @@ void render_workspace(xcb_connection_t *conn, i3Screen *screen, Workspace *r_ws)
         /* Go through the whole table and render what’s necessary */
         FOR_TABLE(r_ws) {
                 Container *container = r_ws->table[cols][rows];
+                if (container == NULL)
+                        continue;
                 int single_width = -1, single_height = -1;
                 /* Update position of the container */
                 container->row = rows;