aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-05-21 13:10:52 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-05-21 13:59:01 +1000
commitc4ea2b51f6dc2ae15cc2bebc9c3b0d4d18dc1766 (patch)
tree4ac655c18b7e27d02dde7708911e8846cc27d30f /sway
parenta9733d96f9c6b2699ce69be34e4d0304d7744ebf (diff)
Fix hide_edge_borders constraints
When checking if a border is on the edge, the check should be done against the workspace rather than the output.
Diffstat (limited to 'sway')
-rw-r--r--sway/tree/view.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 648c1655..192a73c5 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -139,9 +139,10 @@ void view_autoconfigure(struct sway_view *view) {
return;
}
+ struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
+
int other_views = 1;
if (config->hide_edge_borders == E_SMART) {
- struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
other_views = container_count_descendants_of_type(ws, C_VIEW) - 1;
}
@@ -151,16 +152,16 @@ void view_autoconfigure(struct sway_view *view) {
if (config->hide_edge_borders == E_BOTH
|| config->hide_edge_borders == E_VERTICAL
|| (config->hide_edge_borders == E_SMART && !other_views)) {
- view->border_left = view->swayc->x != 0;
+ view->border_left = view->swayc->x != ws->x;
int right_x = view->swayc->x + view->swayc->width;
- view->border_right = right_x != output->width;
+ view->border_right = right_x != ws->x + ws->width;
}
if (config->hide_edge_borders == E_BOTH
|| config->hide_edge_borders == E_HORIZONTAL
|| (config->hide_edge_borders == E_SMART && !other_views)) {
- view->border_top = view->swayc->y != 0;
+ view->border_top = view->swayc->y != ws->y;
int bottom_y = view->swayc->y + view->swayc->height;
- view->border_bottom = bottom_y != output->height;
+ view->border_bottom = bottom_y != ws->y + ws->height;
}
}