aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-09-10 10:17:16 -0400
committerGitHub <noreply@github.com>2016-09-10 10:17:16 -0400
commit7c166e350bf5081f5e5895f588be531d4281634d (patch)
tree699e47bbef6f9dce14615a590c6fad35639cf13e
parent40013029ea81646d3c8e2c7674692555f88bf885 (diff)
parent873dfc07f3d3d55a031674a6ffbc0f5b7febe08f (diff)
downloadsway-7c166e350bf5081f5e5895f588be531d4281634d.zip
sway-7c166e350bf5081f5e5895f588be531d4281634d.tar.gz
sway-7c166e350bf5081f5e5895f588be531d4281634d.tar.bz2
Merge pull request #889 from thejan2009/bugfix/indicator_border
Use indicator border color only when needed.
-rw-r--r--sway/border.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/border.c b/sway/border.c
index 09bf05e..c64fad7 100644
--- a/sway/border.c
+++ b/sway/border.c
@@ -108,6 +108,9 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col
int x = b->origin.x - g->origin.x;
int y = b->origin.y - g->origin.y;
+ // draw vertical/horizontal indicator if container is the only child of its parent container
+ bool is_only_child = view->parent && view->parent->children && view->parent->children->length == 1;
+
// left border
int left_border = v->origin.x - b->origin.x;
if (left_border > 0) {
@@ -121,7 +124,7 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col
// right border
int right_border = b->size.w - v->size.w - left_border;
if (right_border > 0) {
- if (layout == L_HORIZ) {
+ if (is_only_child && layout == L_HORIZ) {
color = colors->indicator;
} else {
color = colors->child_border;
@@ -147,7 +150,7 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col
// bottom border
int bottom_border = b->size.h - (top_border + v->size.h);
if (bottom_border > 0) {
- if (layout == L_VERT) {
+ if (is_only_child && layout == L_VERT) {
color = colors->indicator;
} else {
color = colors->child_border;