aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2016-06-02 10:23:43 -0400
committerFurkan Sahin <furkan-dev@proton.me>2016-06-02 10:23:43 -0400
commit3dbab49cfe2085c3a59f31cc8f4f8afd9b99e1b6 (patch)
tree010cd50673062191847e384987b19b90c2b65459
parente56b5a7da35c79ec3fbb286beb05932cede91e04 (diff)
parent668a8f1d3342516230f208724f69bf65965f5c5d (diff)
Merge pull request #690 from zandrmartin/smartgap-hide-borders
redo smart_gaps/hide_edge_borders fix
-rw-r--r--sway/layout.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 8bf4ce00..952bcf1c 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -567,26 +567,30 @@ void update_geometry(swayc_t *container) {
int border_right = container->border_thickness;
// handle hide_edge_borders
- if (config->hide_edge_borders != E_NONE && gap <= 0) {
+ if (config->hide_edge_borders != E_NONE && (gap <= 0 || (config->smart_gaps && ws->children->length == 1))) {
swayc_t *output = swayc_parent_by_type(container, C_OUTPUT);
const struct wlc_size *size = wlc_output_get_resolution(output->handle);
if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) {
- if (geometry.origin.x == 0) {
+ if (geometry.origin.x == 0 || geometry.origin.x == container->x) {
+ // should work for swaybar at left
border_left = 0;
}
- if (geometry.origin.x + geometry.size.w == size->w) {
+ if (geometry.origin.x + geometry.size.w == size->w || geometry.size.w == container->width) {
+ // should work for swaybar at right
border_right = 0;
}
}
if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) {
- if (geometry.origin.y == 0) {
+ if (geometry.origin.y == 0 || geometry.origin.y == container->y) {
+ // this works for swaybar at top
border_top = 0;
}
- if (geometry.origin.y + geometry.size.h == size->h) {
+ if (geometry.origin.y + geometry.size.h == size->h || geometry.size.h == container->height) {
+ // this works for swaybar at bottom
border_bottom = 0;
}
}