From cea010afecfe34aaf2d7f590367c4a860eea0002 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 17 Feb 2019 18:27:19 +0000 Subject: [PATCH] Ignore the map/unmap of input only windows Fixes some misleading warning messages. Signed-off-by: Yuxuan Shui --- src/win.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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;