summaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-07 22:42:18 -0500
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-07 22:42:18 -0500
commit6a42643784520e87a043344640e5be9cb67439e3 (patch)
treea3696d7b4e32e7f7c254d06486da9140160f7a04 /sway/tree/view.c
parentAdd focus_follows_mouse always. (#3081) (diff)
downloadsway-6a42643784520e87a043344640e5be9cb67439e3.tar.gz
sway-6a42643784520e87a043344640e5be9cb67439e3.tar.zst
sway-6a42643784520e87a043344640e5be9cb67439e3.zip
gaps: remove duplicate inner gaps
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 1aa59e68..03bb01d3 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -185,7 +185,8 @@ bool view_is_only_visible(struct sway_view *view) {
185static bool gaps_to_edge(struct sway_view *view) { 185static bool gaps_to_edge(struct sway_view *view) {
186 struct sway_container *con = view->container; 186 struct sway_container *con = view->container;
187 while (con) { 187 while (con) {
188 if (con->current_gaps > 0) { 188 if (con->current_gaps.top > 0 || con->current_gaps.right > 0 ||
189 con->current_gaps.bottom > 0 || con->current_gaps.left > 0) {
189 return true; 190 return true;
190 } 191 }
191 con = con->parent; 192 con = con->parent;
@@ -222,15 +223,15 @@ void view_autoconfigure(struct sway_view *view) {
222 if (config->hide_edge_borders == E_BOTH 223 if (config->hide_edge_borders == E_BOTH
223 || config->hide_edge_borders == E_VERTICAL 224 || config->hide_edge_borders == E_VERTICAL
224 || (smart && !other_views && no_gaps)) { 225 || (smart && !other_views && no_gaps)) {
225 con->border_left = con->x - con->current_gaps != ws->x; 226 con->border_left = con->x - con->current_gaps.left != ws->x;
226 int right_x = con->x + con->width + con->current_gaps; 227 int right_x = con->x + con->width + con->current_gaps.right;
227 con->border_right = right_x != ws->x + ws->width; 228 con->border_right = right_x != ws->x + ws->width;
228 } 229 }
229 if (config->hide_edge_borders == E_BOTH 230 if (config->hide_edge_borders == E_BOTH
230 || config->hide_edge_borders == E_HORIZONTAL 231 || config->hide_edge_borders == E_HORIZONTAL
231 || (smart && !other_views && no_gaps)) { 232 || (smart && !other_views && no_gaps)) {
232 con->border_top = con->y - con->current_gaps != ws->y; 233 con->border_top = con->y - con->current_gaps.top != ws->y;
233 int bottom_y = con->y + con->height + con->current_gaps; 234 int bottom_y = con->y + con->height + con->current_gaps.bottom;
234 con->border_bottom = bottom_y != ws->y + ws->height; 235 con->border_bottom = bottom_y != ws->y + ws->height;
235 } 236 }
236 237