summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-07-21 16:56:44 -0400
committerLibravatar GitHub <noreply@github.com>2016-07-21 16:56:44 -0400
commit9fe1d3da381296966e01d922ce6e54d0e55e7c00 (patch)
treeda08882e578e55e1a39e2f20ad359330ad20fe7d
parentMerge pull request #777 from Hummer12007/bg-arng (diff)
parentrename ws to workspace for clarity (diff)
downloadsway-9fe1d3da381296966e01d922ce6e54d0e55e7c00.tar.gz
sway-9fe1d3da381296966e01d922ce6e54d0e55e7c00.tar.zst
sway-9fe1d3da381296966e01d922ce6e54d0e55e7c00.zip
Merge pull request #778 from thejan2009/hide_edge_borders-fix
Hide edge borders fix
-rw-r--r--sway/layout.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/sway/layout.c b/sway/layout.c
index faa108a1..3285560b 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -522,8 +522,8 @@ void update_geometry(swayc_t *container) {
522 return; 522 return;
523 } 523 }
524 524
525 swayc_t *ws = swayc_parent_by_type(container, C_WORKSPACE); 525 swayc_t *workspace = swayc_parent_by_type(container, C_WORKSPACE);
526 swayc_t *op = ws->parent; 526 swayc_t *op = workspace->parent;
527 swayc_t *parent = container->parent; 527 swayc_t *parent = container->parent;
528 528
529 struct wlc_geometry geometry = { 529 struct wlc_geometry geometry = {
@@ -552,7 +552,7 @@ void update_geometry(swayc_t *container) {
552 geometry.origin.y = 0; 552 geometry.origin.y = 0;
553 geometry.size.w = size->w; 553 geometry.size.w = size->w;
554 geometry.size.h = size->h; 554 geometry.size.h = size->h;
555 if (op->focused == ws) { 555 if (op->focused == workspace) {
556 wlc_view_bring_to_front(container->handle); 556 wlc_view_bring_to_front(container->handle);
557 } 557 }
558 558
@@ -570,30 +570,23 @@ void update_geometry(swayc_t *container) {
570 int border_right = container->border_thickness; 570 int border_right = container->border_thickness;
571 571
572 // handle hide_edge_borders 572 // handle hide_edge_borders
573 if (config->hide_edge_borders != E_NONE && (gap <= 0 || (config->smart_gaps && ws->children->length == 1))) { 573 if (config->hide_edge_borders != E_NONE && (gap <= 0 || (config->smart_gaps && workspace->children->length == 1))) {
574 swayc_t *output = swayc_parent_by_type(container, C_OUTPUT);
575 const struct wlc_size *size = wlc_output_get_resolution(output->handle);
576
577 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) {
578 if (geometry.origin.x == 0 || geometry.origin.x == container->x) { 575 if (geometry.origin.x == workspace->x) {
579 // should work for swaybar at left
580 border_left = 0; 576 border_left = 0;
581 } 577 }
582 578
583 if (geometry.origin.x + geometry.size.w == size->w || geometry.size.w == container->width) { 579 if (geometry.origin.x + geometry.size.w == workspace->width) {
584 // should work for swaybar at right
585 border_right = 0; 580 border_right = 0;
586 } 581 }
587 } 582 }
588 583
589 if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) { 584 if (config->hide_edge_borders == E_VERTICAL || config->hide_edge_borders == E_BOTH) {
590 if (geometry.origin.y == 0 || geometry.origin.y == container->y) { 585 if (geometry.origin.y == workspace->y) {
591 // this works for swaybar at top
592 border_top = 0; 586 border_top = 0;
593 } 587 }
594 588
595 if (geometry.origin.y + geometry.size.h == size->h || geometry.size.h == container->height) { 589 if (geometry.origin.y + geometry.size.h == workspace->height) {
596 // this works for swaybar at bottom
597 border_bottom = 0; 590 border_bottom = 0;
598 } 591 }
599 } 592 }