diff --git a/src/win.c b/src/win.c index 95a7860..2f78fe3 100644 --- a/src/win.c +++ b/src/win.c @@ -1384,13 +1384,14 @@ void unmap_win(session_t *ps, win **_w, bool destroy) { win *w = *_w; - log_trace("Unmapping %#010x \"%s\", destroy = %d", w->id, (w ? w->name: NULL), destroy); winstate_t target_state = destroy ? WSTATE_DESTROYING : WSTATE_UNMAPPING; - if (unlikely(!w)) { + if (unlikely(!w) || w->a._class == XCB_WINDOW_CLASS_INPUT_ONLY) { return; } + log_trace("Unmapping %#010x \"%s\", destroy = %d", w->id, (w ? w->name: NULL), destroy); + if (unlikely(w->state == WSTATE_DESTROYING && !destroy)) { log_warn("Trying to undestroy a window?"); assert(false); @@ -1506,8 +1507,6 @@ map_win(session_t *ps, xcb_window_t id) { } win *w = find_win(ps, id); - log_debug("Mapping (%#010x \"%s\")", id, (w ? w->name: NULL)); - // Don't care about window mapping if it's an InputOnly window // Also, try avoiding mapping a window twice // TODO don't even add the input only windows @@ -1515,6 +1514,8 @@ map_win(session_t *ps, xcb_window_t id) { return; } + log_debug("Mapping (%#010x \"%s\")", id, (w ? w->name: NULL)); + if (w->state != WSTATE_UNMAPPED && w->state != WSTATE_UNMAPPING) { log_warn("Mapping an already mapped window"); return;