aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Denis Doria <denisdoria@gmail.com>2016-06-02 17:36:51 +0200
committerLibravatar Denis Doria <denisdoria@gmail.com>2016-06-02 17:36:51 +0200
commit2256a9b784d6885822a428a2760838693bd75d94 (patch)
treefad070df6be2bef62346c4a8232d869e3cf41fdc
parentInitial implementation for floating_maximum_size (diff)
parentMerge pull request #690 from zandrmartin/smartgap-hide-borders (diff)
downloadsway-2256a9b784d6885822a428a2760838693bd75d94.tar.gz
sway-2256a9b784d6885822a428a2760838693bd75d94.tar.zst
sway-2256a9b784d6885822a428a2760838693bd75d94.zip
Sync master
Merge branch 'master' of https://github.com/SirCmpwn/sway into floating_size_conf
-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 }