From 26635a7595b9c06834df68bab3c0371046fd7230 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 1 Apr 2011 21:54:45 +0200 Subject: [PATCH] x: skip creating pixmaps when the rect is actually invisible This fixes a few X11 errors. --- src/x.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/x.c b/src/x.c index 995b4373..ee9e0a43 100644 --- a/src/x.c +++ b/src/x.c @@ -510,9 +510,12 @@ static void x_push_node(Con *con) { xcb_set_window_rect(conn, con->frame, rect); /* As the pixmap only depends on the size and not on the position, it - * is enough to check if width/height have changed */ - if (state->rect.width != rect.width || - state->rect.height != rect.height) { + * 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 || + state->rect.height != rect.height)) { DLOG("CACHE: creating new pixmap\n"); if (con->pixmap == 0) { con->pixmap = xcb_generate_id(conn); -- 2.39.5