Ignore the map/unmap of input only windows

Fixes some misleading warning messages.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-02-17 18:27:19 +00:00
parent 635351c820
commit cea010afec
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 5 additions and 4 deletions

View File

@ -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;