aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-06-02 10:23:43 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-06-02 10:23:43 -0400
commit5e395d696259283953e5b3944cfe5ab92963c189 (patch)
tree010cd50673062191847e384987b19b90c2b65459
parentMerge pull request #689 from thuck/floating_size_conf (diff)
parentredo smart_gaps/hide_edge_borders fix (diff)
downloadsway-5e395d696259283953e5b3944cfe5ab92963c189.tar.gz
sway-5e395d696259283953e5b3944cfe5ab92963c189.tar.zst
sway-5e395d696259283953e5b3944cfe5ab92963c189.zip
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) {
567 int border_right = container->border_thickness; 567 int border_right = container->border_thickness;
568 568
569 // handle hide_edge_borders 569 // handle hide_edge_borders
570 if (config->hide_edge_borders != E_NONE && gap <= 0) { 570 if (config->hide_edge_borders != E_NONE && (gap <= 0 || (config->smart_gaps && ws->children->length == 1))) {
571 swayc_t *output = swayc_parent_by_type(container, C_OUTPUT); 571 swayc_t *output = swayc_parent_by_type(container, C_OUTPUT);
572 const struct wlc_size *size = wlc_output_get_resolution(output->handle); 572 const struct wlc_size *size = wlc_output_get_resolution(output->handle);
573 573
574 if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) { 574 if (config->hide_edge_borders == E_HORIZONTAL || config->hide_edge_borders == E_BOTH) {
575 if (geometry.origin.x == 0) { 575 if (geometry.origin.x == 0 || geometry.origin.x == container->x) {
576 // should work for swaybar at left
576 border_left = 0; 577 border_left = 0;
577 } 578 }
578 579
579 if (geometry.origin.x + geometry.size.w == size->w) { 580 if (geometry.origin.x + geometry.size.w == size->w || geometry.size.w == container->width) {
581 // should work for swaybar at right
580 border_right = 0; 582 border_right = 0;
581 } 583 }
582 } 584 }
583 585
584 if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) { 586 if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) {
585 if (geometry.origin.y == 0) { 587 if (geometry.origin.y == 0 || geometry.origin.y == container->y) {
588 // this works for swaybar at top
586 border_top = 0; 589 border_top = 0;
587 } 590 }
588 591
589 if (geometry.origin.y + geometry.size.h == size->h) { 592 if (geometry.origin.y + geometry.size.h == size->h || geometry.size.h == container->height) {
593 // this works for swaybar at bottom
590 border_bottom = 0; 594 border_bottom = 0;
591 } 595 }
592 } 596 }