aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 1aa59e68..21b32649 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -185,12 +185,14 @@ bool view_is_only_visible(struct sway_view *view) {
static bool gaps_to_edge(struct sway_view *view) {
struct sway_container *con = view->container;
while (con) {
- if (con->current_gaps > 0) {
+ if (con->current_gaps.top > 0 || con->current_gaps.right > 0 ||
+ con->current_gaps.bottom > 0 || con->current_gaps.left > 0) {
return true;
}
con = con->parent;
}
- return view->container->workspace->current_gaps > 0;
+ struct side_gaps gaps = view->container->workspace->current_gaps;
+ return gaps.top > 0 || gaps.right > 0 || gaps.bottom > 0 || gaps.left > 0;
}
void view_autoconfigure(struct sway_view *view) {
@@ -222,15 +224,15 @@ void view_autoconfigure(struct sway_view *view) {
if (config->hide_edge_borders == E_BOTH
|| config->hide_edge_borders == E_VERTICAL
|| (smart && !other_views && no_gaps)) {
- con->border_left = con->x - con->current_gaps != ws->x;
- int right_x = con->x + con->width + con->current_gaps;
+ con->border_left = con->x - con->current_gaps.left != ws->x;
+ int right_x = con->x + con->width + con->current_gaps.right;
con->border_right = right_x != ws->x + ws->width;
}
if (config->hide_edge_borders == E_BOTH
|| config->hide_edge_borders == E_HORIZONTAL
|| (smart && !other_views && no_gaps)) {
- con->border_top = con->y - con->current_gaps != ws->y;
- int bottom_y = con->y + con->height + con->current_gaps;
+ con->border_top = con->y - con->current_gaps.top != ws->y;
+ int bottom_y = con->y + con->height + con->current_gaps.bottom;
con->border_bottom = bottom_y != ws->y + ws->height;
}