From 85b7e60bacfbb3983a66533c6b17edf2c2c6cd1a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 28 Nov 2010 22:08:34 +0100 Subject: [PATCH] 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. --- src/x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.39.5