From: Michael Stapelberg Date: Wed, 25 Feb 2009 01:05:08 +0000 (+0100) Subject: Bugfix: Correctly map/unmap stack windows X-Git-Tag: 3.a~151 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0edc523885a6abb010a192cf77c6967294170261;p=i3%2Fi3 Bugfix: Correctly map/unmap stack windows --- diff --git a/src/commands.c b/src/commands.c index e05c0af5..38ce6ef1 100644 --- a/src/commands.c +++ b/src/commands.c @@ -298,6 +298,12 @@ static void show_workspace(xcb_connection_t *conn, int workspace) { CIRCLEQ_FOREACH(client, &(c_ws->table[cols][rows]->clients), clients) xcb_unmap_window(conn, client->frame); + /* Unmap the stack windows on the current workspace, if any */ + struct Stack_Window *stack_win; + SLIST_FOREACH(stack_win, &stack_wins, stack_windows) + if (stack_win->container->workspace == c_ws) + xcb_unmap_window(conn, stack_win->window); + c_ws = &workspaces[workspace-1]; current_row = c_ws->current_row; current_col = c_ws->current_col; @@ -309,6 +315,11 @@ static void show_workspace(xcb_connection_t *conn, int workspace) { CIRCLEQ_FOREACH(client, &(c_ws->table[cols][rows]->clients), clients) xcb_map_window(conn, client->frame); + /* Map all stack windows, if any */ + SLIST_FOREACH(stack_win, &stack_wins, stack_windows) + if (stack_win->container->workspace == c_ws) + xcb_map_window(conn, stack_win->window); + /* Restore focus on the new workspace */ if (CUR_CELL->currently_focused != NULL) xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, CUR_CELL->currently_focused->child, XCB_CURRENT_TIME);