aboutsummaryrefslogtreecommitdiff
path: root/sway/border.c
diff options
context:
space:
mode:
authorZandr Martin <zandrmartin@gmail.com>2016-07-30 08:44:21 -0500
committerZandr Martin <zandrmartin@gmail.com>2016-07-30 08:44:21 -0500
commite6af5f8bdbd98d1ece927b67d9ef881f3511e087 (patch)
tree1867cf64da858a89a2fda1884bf25c2809770f6c /sway/border.c
parentc0683a0444e852fb812686f7028450edc77eb170 (diff)
parente3104a48e387a91b12952089595f447f286f3fea (diff)
Merge branch 'master' of git://github.com/SirCmpwn/sway into x11-pids
Diffstat (limited to 'sway/border.c')
-rw-r--r--sway/border.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sway/border.c b/sway/border.c
index d17d8d0c..c1a62bc6 100644
--- a/sway/border.c
+++ b/sway/border.c
@@ -332,10 +332,12 @@ void update_view_border(swayc_t *view) {
}
};
cr = create_border_buffer(view, g, &surface);
+
+ bool render_top = !should_hide_top_border(view, view->y);
if (view == focused) {
- render_borders(view, cr, &config->border_colors.focused, false);
+ render_borders(view, cr, &config->border_colors.focused, render_top);
} else {
- render_borders(view, cr, &config->border_colors.focused_inactive, false);
+ render_borders(view, cr, &config->border_colors.focused_inactive, render_top);
}
// generate container titles
@@ -418,3 +420,17 @@ void render_view_borders(wlc_handle view) {
wlc_pixels_write(WLC_RGBA8888, &c->border->geometry, c->border->buffer);
}
}
+
+bool should_hide_top_border(swayc_t *con, double y) {
+ // returns true if container is child of tabbed/stacked layout and is
+ // sharing top border with tabbed titlebar
+ swayc_t *par = con->parent;
+ while (par->type != C_WORKSPACE) {
+ if (par->layout == L_TABBED || par->layout == L_STACKED) {
+ return con->y == y;
+ }
+ con = par;
+ par = par->parent;
+ }
+ return false;
+}