]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Don’t fill split cons etc. with client background color (fixes nested decorat...
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 11 May 2011 20:01:09 +0000 (22:01 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 11 May 2011 20:01:09 +0000 (22:01 +0200)
Fixes: #359
src/x.c

diff --git a/src/x.c b/src/x.c
index 358a2201a1b1c8ed47801dbd7b83576c4a2acb81..76add0ff7090fdfc1fcbd9b97506c25548a4fa47 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -303,28 +303,30 @@ void x_draw_decoration(Con *con) {
         deco_rect.height = 0;
 
     /* 2: draw the client.background, but only for the parts around the client_rect */
-    xcb_rectangle_t background[] = {
-        /* top area */
-        { 0, 0, r->width, w->y },
-        /* bottom area */
-        { 0, (w->y + w->height), r->width, r->height - (w->y + w->height) },
-        /* left area */
-        { 0, 0, w->x, r->height },
-        /* right area */
-        { w->x + w->width, 0, r->width - (w->x + w->width), r->height }
-    };
+    if (con->window != NULL) {
+        xcb_rectangle_t background[] = {
+            /* top area */
+            { 0, 0, r->width, w->y },
+            /* bottom area */
+            { 0, (w->y + w->height), r->width, r->height - (w->y + w->height) },
+            /* left area */
+            { 0, 0, w->x, r->height },
+            /* right area */
+            { w->x + w->width, 0, r->width - (w->x + w->width), r->height }
+        };
 #if 0
-    for (int i = 0; i < 4; i++)
-        DLOG("rect is (%d, %d) with %d x %d\n",
-                background[i].x,
-                background[i].y,
-                background[i].width,
-                background[i].height
-            );
+        for (int i = 0; i < 4; i++)
+            DLOG("rect is (%d, %d) with %d x %d\n",
+                    background[i].x,
+                    background[i].y,
+                    background[i].width,
+                    background[i].height
+                );
 #endif
 
-    xcb_change_gc_single(conn, con->pm_gc, XCB_GC_FOREGROUND, config.client.background);
-    xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, sizeof(background) / sizeof(xcb_rectangle_t), background);
+        xcb_change_gc_single(conn, con->pm_gc, XCB_GC_FOREGROUND, config.client.background);
+        xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, sizeof(background) / sizeof(xcb_rectangle_t), background);
+    }
 
     /* 3: draw a rectangle in border color around the client */
     if (p->border_style != BS_NONE && p->con_is_leaf) {