aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2018-05-21 13:18:18 -0400
committerBrian Ashworth <bosrsf04@gmail.com>2018-05-21 13:18:18 -0400
commit0273c6438c13dfd98204ba07fd42dac0081b0c7f (patch)
tree2a482d99f195e268ceb94a44f550610a6f3a95d0
parenta7adbf4b79dce4d61de1a8a71cba535aeae6bc76 (diff)
Fix hide_edge_borders smart for tabs and stacks
-rw-r--r--sway/tree/view.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 64597c02..c013e635 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -141,9 +141,18 @@ void view_autoconfigure(struct sway_view *view) {
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
- int other_views = 1;
+ int other_views = 0;
if (config->hide_edge_borders == E_SMART) {
- other_views = container_count_descendants_of_type(ws, C_VIEW) - 1;
+ struct sway_container *con = view->swayc;
+ while (con != output) {
+ if (con->layout != L_TABBED && con->layout != L_STACKED) {
+ other_views += con->children ? con->children->length - 1 : 0;
+ if (other_views > 0) {
+ break;
+ }
+ }
+ con = con->parent;
+ }
}
view->border_top = view->border_bottom = true;