summaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-21 13:10:52 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-21 13:59:01 +1000
commitc4ea2b51f6dc2ae15cc2bebc9c3b0d4d18dc1766 (patch)
tree4ac655c18b7e27d02dde7708911e8846cc27d30f /sway/tree/view.c
parentMerge pull request #2012 from RedSoxFan/fix-border-changing-focus (diff)
downloadsway-c4ea2b51f6dc2ae15cc2bebc9c3b0d4d18dc1766.tar.gz
sway-c4ea2b51f6dc2ae15cc2bebc9c3b0d4d18dc1766.tar.zst
sway-c4ea2b51f6dc2ae15cc2bebc9c3b0d4d18dc1766.zip
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/tree/view.c')
-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) {
139 return; 139 return;
140 } 140 }
141 141
142 struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
143
142 int other_views = 1; 144 int other_views = 1;
143 if (config->hide_edge_borders == E_SMART) { 145 if (config->hide_edge_borders == E_SMART) {
144 struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
145 other_views = container_count_descendants_of_type(ws, C_VIEW) - 1; 146 other_views = container_count_descendants_of_type(ws, C_VIEW) - 1;
146 } 147 }
147 148
@@ -151,16 +152,16 @@ void view_autoconfigure(struct sway_view *view) {
151 if (config->hide_edge_borders == E_BOTH 152 if (config->hide_edge_borders == E_BOTH
152 || config->hide_edge_borders == E_VERTICAL 153 || config->hide_edge_borders == E_VERTICAL
153 || (config->hide_edge_borders == E_SMART && !other_views)) { 154 || (config->hide_edge_borders == E_SMART && !other_views)) {
154 view->border_left = view->swayc->x != 0; 155 view->border_left = view->swayc->x != ws->x;
155 int right_x = view->swayc->x + view->swayc->width; 156 int right_x = view->swayc->x + view->swayc->width;
156 view->border_right = right_x != output->width; 157 view->border_right = right_x != ws->x + ws->width;
157 } 158 }
158 if (config->hide_edge_borders == E_BOTH 159 if (config->hide_edge_borders == E_BOTH
159 || config->hide_edge_borders == E_HORIZONTAL 160 || config->hide_edge_borders == E_HORIZONTAL
160 || (config->hide_edge_borders == E_SMART && !other_views)) { 161 || (config->hide_edge_borders == E_SMART && !other_views)) {
161 view->border_top = view->swayc->y != 0; 162 view->border_top = view->swayc->y != ws->y;
162 int bottom_y = view->swayc->y + view->swayc->height; 163 int bottom_y = view->swayc->y + view->swayc->height;
163 view->border_bottom = bottom_y != output->height; 164 view->border_bottom = bottom_y != ws->y + ws->height;
164 } 165 }
165 } 166 }
166 167