From 937a80511a887f88e1ae3888ba533283ad146a18 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 10 Jul 2011 22:59:04 +0200 Subject: [PATCH] x: only configure window coordinates when height > 0 Fixes some X11 errors --- src/x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/x.c b/src/x.c index 791069d5..3c2e1ef6 100644 --- a/src/x.c +++ b/src/x.c @@ -558,8 +558,9 @@ void x_push_node(Con *con) { } bool fake_notify = false; - /* set new position if rect changed */ - if (memcmp(&(state->rect), &rect, sizeof(Rect)) != 0) { + /* Set new position if rect changed (and if height > 0) */ + if (memcmp(&(state->rect), &rect, sizeof(Rect)) != 0 && + rect.height > 0) { /* We first create the new pixmap, then render to it, set it as the * background and only afterwards change the window size. This reduces * flickering. */ @@ -568,8 +569,7 @@ void x_push_node(Con *con) { * is enough to check if width/height have changed. Also, we don’t * create a pixmap at all when the window is actually not visible * (height == 0). */ - if (rect.height > 0 && - (state->rect.width != rect.width || + if ((state->rect.width != rect.width || state->rect.height != rect.height)) { DLOG("CACHE: creating new pixmap for con %p (old: %d x %d, new: %d x %d)\n", con, state->rect.width, state->rect.height, -- 2.39.5