summaryrefslogtreecommitdiffstats
path: root/sway/border.c
diff options
context:
space:
mode:
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) {
332 } 332 }
333 }; 333 };
334 cr = create_border_buffer(view, g, &surface); 334 cr = create_border_buffer(view, g, &surface);
335
336 bool render_top = !should_hide_top_border(view, view->y);
335 if (view == focused) { 337 if (view == focused) {
336 render_borders(view, cr, &config->border_colors.focused, false); 338 render_borders(view, cr, &config->border_colors.focused, render_top);
337 } else { 339 } else {
338 render_borders(view, cr, &config->border_colors.focused_inactive, false); 340 render_borders(view, cr, &config->border_colors.focused_inactive, render_top);
339 } 341 }
340 342
341 // generate container titles 343 // generate container titles
@@ -418,3 +420,17 @@ void render_view_borders(wlc_handle view) {
418 wlc_pixels_write(WLC_RGBA8888, &c->border->geometry, c->border->buffer); 420 wlc_pixels_write(WLC_RGBA8888, &c->border->geometry, c->border->buffer);
419 } 421 }
420} 422}
423
424bool should_hide_top_border(swayc_t *con, double y) {
425 // returns true if container is child of tabbed/stacked layout and is
426 // sharing top border with tabbed titlebar
427 swayc_t *par = con->parent;
428 while (par->type != C_WORKSPACE) {
429 if (par->layout == L_TABBED || par->layout == L_STACKED) {
430 return con->y == y;
431 }
432 con = par;
433 par = par->parent;
434 }
435 return false;
436}