From: Michael Stapelberg Date: Wed, 5 Aug 2009 22:37:39 +0000 (+0200) Subject: Bugfix: Correctly unmap stack windows and don’t re-map them too early X-Git-Tag: 3.c~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=20875494ee930dd3d20ef37569516716ac68932b;p=i3%2Fi3 Bugfix: Correctly unmap stack windows and don’t re-map them too early --- diff --git a/src/client.c b/src/client.c index 81430b2f..5ed5cf97 100644 --- a/src/client.c +++ b/src/client.c @@ -39,9 +39,11 @@ void client_remove_from_container(xcb_connection_t *conn, Client *client, Contai /* If the container will be empty now and is in stacking mode, we need to unmap the stack_win */ if (CIRCLEQ_EMPTY(&(container->clients)) && container->mode == MODE_STACK) { + LOG("Unmapping stack window\n"); struct Stack_Window *stack_win = &(container->stack_win); stack_win->rect.height = 0; xcb_unmap_window(conn, stack_win->window); + xcb_flush(conn); } } diff --git a/src/layout.c b/src/layout.c index 9cc41a0c..d90460a4 100644 --- a/src/layout.c +++ b/src/layout.c @@ -334,7 +334,7 @@ void render_container(xcb_connection_t *conn, Container *container) { /* Check if we need to remap our stack title window, it gets unmapped when the container is empty in src/handlers.c:unmap_notify() */ - if (stack_win->rect.height == 0) + if (stack_win->rect.height == 0 && num_clients > 0) xcb_map_window(conn, stack_win->window); /* Check if we need to reconfigure our stack title window */ diff --git a/src/util.c b/src/util.c index d09dafe2..8b400864 100644 --- a/src/util.c +++ b/src/util.c @@ -424,7 +424,9 @@ void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode) XCB_EVENT_MASK_EXPOSURE; /* …our window needs to be redrawn */ struct Stack_Window *stack_win = &(container->stack_win); - stack_win->window = create_window(conn, rect, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_CURSOR_LEFT_PTR, true, mask, values); + stack_win->window = create_window(conn, rect, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_CURSOR_LEFT_PTR, false, mask, values); + + stack_win->rect.height = 0; /* Initialize the entry for our cached pixmap. It will be * created as soon as it’s needed (see cached_pixmap_prepare). */