From: Michael Stapelberg Date: Sun, 28 Nov 2010 21:08:34 +0000 (+0100) Subject: Bugfix: Use separate child_mapped instead of checking state->initial (makes t/02... X-Git-Tag: tree-pr1~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=85b7e60bacfbb3983a66533c6b17edf2c2c6cd1a;p=i3%2Fi3 Bugfix: Use separate child_mapped instead of checking state->initial (makes t/02-fullscreen.t pass) This is necessary for windows which are mapped later, for example when there is a fullscreen window in front of everything. --- diff --git a/src/x.c b/src/x.c index ca292b2c..11efa5e5 100644 --- a/src/x.c +++ b/src/x.c @@ -18,6 +18,7 @@ static xcb_window_t focused_id = XCB_NONE; typedef struct con_state { xcb_window_t id; bool mapped; + bool child_mapped; /* For reparenting, we have a flag (need_reparent) and the X ID of the old * frame this window was in. The latter is necessary because we need to @@ -111,6 +112,7 @@ void x_reinit(Con *con) { LOG("resetting state %p to initial\n", state); state->initial = true; + state->child_mapped = false; memset(&(state->window_rect), 0, sizeof(Rect)); } @@ -466,11 +468,12 @@ static void x_push_node(Con *con) { atoms[WM_STATE], atoms[WM_STATE], 32, 2, data); } - if (state->initial && con->window != NULL) { + if (!state->child_mapped && con->window != NULL) { cookie = xcb_map_window(conn, con->window->id); LOG("mapping child window (serial %d)\n", cookie.sequence); /* Ignore enter_notifies which are generated when mapping */ add_ignore_event(cookie.sequence); + state->child_mapped = true; } cookie = xcb_map_window(conn, con->frame);