]> git.sur5r.net Git - i3/i3/commitdiff
Draw indicator border only for split layouts
authorDiego Ongaro <ongardie@gmail.com>
Mon, 29 Apr 2013 08:14:11 +0000 (01:14 -0700)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 22 May 2013 17:35:33 +0000 (19:35 +0200)
In order to distinguish split layouts from tabbed/stacking layouts when
only one window is shown, do not draw the indicator border for tabbed or
stacking layouts.

include/data.h
src/x.c

index 83f9d80b5c6d8ffbf0bd8e813e12a23a5aec3340..31407f3c7bc4772f264c7e00e3b23c3916d5e368 100644 (file)
@@ -147,7 +147,7 @@ struct deco_render_params {
     Rect con_deco_rect;
     uint32_t background;
     bool con_is_leaf;
-    orientation_t parent_orientation;
+    layout_t parent_layout;
 };
 
 /**
diff --git a/src/x.c b/src/x.c
index ae6e8a600cc7f1f9044ce7d5848137baa6d63bf9..f86559460ed213722fa70bbc1714d0e04636e13a 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -351,7 +351,7 @@ void x_draw_decoration(Con *con) {
     p->con_deco_rect = con->deco_rect;
     p->background = config.client.background;
     p->con_is_leaf = con_is_leaf(con);
-    p->parent_orientation = con_orientation(parent);
+    p->parent_layout = con->parent->layout;
 
     if (con->deco_render_params != NULL &&
         (con->window == NULL || !con->window->name_x_changed) &&
@@ -446,10 +446,10 @@ void x_draw_decoration(Con *con) {
             TAILQ_PREV(con, nodes_head, nodes) == NULL &&
             con->parent->type != CT_FLOATING_CON) {
             xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){ p->color->indicator });
-            if (p->parent_orientation == HORIZ)
+            if (p->parent_layout == L_SPLITH)
                 xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){
                         { r->width + br.width + br.x, br.y, r->width, r->height + br.height } });
-            else
+            else if (p->parent_layout == L_SPLITV)
                 xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){
                         { br.x, r->height + br.height + br.y, r->width - (2 * br.x), r->height } });
         }