]> git.sur5r.net Git - i3/i3/commitdiff
Don’t render if no stack_window has been opened
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 6 Mar 2010 15:34:07 +0000 (16:34 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 6 Mar 2010 15:34:07 +0000 (16:34 +0100)
This could happen when you have only one client in a stacking/tabbed
container. While not being a critical bug, this avoids X errors.

src/layout.c

index 31ee404e3ffbccb34abd43a80b3b61b67d8dccc2..ddf79f8a6aeb1116303bee13926b16aac7ab4b32 100644 (file)
@@ -529,8 +529,10 @@ void render_container(xcb_connection_t *conn, Container *container) {
                                 }
                                 offset_x = current_client++ * size_each;
                         }
-                        decorate_window(conn, client, stack_win->pixmap.id, stack_win->pixmap.gc,
-                                        offset_x, offset_y);
+                        if (stack_win->pixmap.id == XCB_NONE)
+                                continue;
+                        decorate_window(conn, client, stack_win->pixmap.id,
+                                        stack_win->pixmap.gc, offset_x, offset_y);
                 }
 
                 /* Check if we need to fill one column because of an uneven
@@ -557,6 +559,8 @@ void render_container(xcb_connection_t *conn, Container *container) {
                         }
                 }
 
+                if (stack_win->pixmap.id == XCB_NONE)
+                        return;
                 xcb_copy_area(conn, stack_win->pixmap.id, stack_win->window, stack_win->pixmap.gc,
                               0, 0, 0, 0, stack_win->rect.width, stack_win->rect.height);
         }