summaryrefslogtreecommitdiffstats
path: root/sway/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/sway/layout.c b/sway/layout.c
index fc7a31b4..db9787f3 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -406,20 +406,21 @@ static void update_border_geometry_floating(swayc_t *c, struct wlc_geometry *geo
406 c->actual_geometry = g; 406 c->actual_geometry = g;
407 407
408 swayc_t *output = swayc_parent_by_type(c, C_OUTPUT); 408 swayc_t *output = swayc_parent_by_type(c, C_OUTPUT);
409 const struct wlc_size *res = wlc_output_get_resolution(output->handle); 409 struct wlc_size res;
410 output_get_scaled_size(output->handle, &res);
410 411
411 switch (c->border_type) { 412 switch (c->border_type) {
412 case B_NONE: 413 case B_NONE:
413 break; 414 break;
414 case B_PIXEL: 415 case B_PIXEL:
415 adjust_border_geometry(c, &g, res, c->border_thickness, 416 adjust_border_geometry(c, &g, &res, c->border_thickness,
416 c->border_thickness, c->border_thickness, c->border_thickness); 417 c->border_thickness, c->border_thickness, c->border_thickness);
417 break; 418 break;
418 case B_NORMAL: 419 case B_NORMAL:
419 { 420 {
420 int title_bar_height = config->font_height + 4; // borders + padding 421 int title_bar_height = config->font_height + 4; // borders + padding
421 422
422 adjust_border_geometry(c, &g, res, c->border_thickness, 423 adjust_border_geometry(c, &g, &res, c->border_thickness,
423 c->border_thickness, title_bar_height, c->border_thickness); 424 c->border_thickness, title_bar_height, c->border_thickness);
424 425
425 struct wlc_geometry title_bar = { 426 struct wlc_geometry title_bar = {
@@ -545,13 +546,15 @@ void update_geometry(swayc_t *container) {
545 gap = update_gap_geometry(container, &geometry); 546 gap = update_gap_geometry(container, &geometry);
546 } 547 }
547 548
549 swayc_t *output = swayc_parent_by_type(container, C_OUTPUT);
550 struct wlc_size size;
551 output_get_scaled_size(output->handle, &size);
552
548 if (swayc_is_fullscreen(container)) { 553 if (swayc_is_fullscreen(container)) {
549 swayc_t *output = swayc_parent_by_type(container, C_OUTPUT);
550 const struct wlc_size *size = wlc_output_get_resolution(output->handle);
551 geometry.origin.x = 0; 554 geometry.origin.x = 0;
552 geometry.origin.y = 0; 555 geometry.origin.y = 0;
553 geometry.size.w = size->w; 556 geometry.size.w = size.w;
554 geometry.size.h = size->h; 557 geometry.size.h = size.h;
555 if (op->focused == workspace) { 558 if (op->focused == workspace) {
556 wlc_view_bring_to_front(container->handle); 559 wlc_view_bring_to_front(container->handle);
557 } 560 }
@@ -576,7 +579,9 @@ void update_geometry(swayc_t *container) {
576 border_left = 0; 579 border_left = 0;
577 } 580 }
578 581
579 if (geometry.origin.x + geometry.size.w == workspace->x + workspace->width) { 582 if (geometry.origin.x + geometry.size.w == size.w ||
583 geometry.size.w == container->x + container->width) {
584 // should work for swaybar at right
580 border_right = 0; 585 border_right = 0;
581 } 586 }
582 } 587 }
@@ -586,7 +591,9 @@ void update_geometry(swayc_t *container) {
586 border_top = 0; 591 border_top = 0;
587 } 592 }
588 593
589 if (geometry.origin.y + geometry.size.h == workspace->y + workspace->height) { 594 if (geometry.origin.y + geometry.size.h == size.h ||
595 geometry.size.h == container->y + container->height) {
596 // this works for swaybar at bottom
590 border_bottom = 0; 597 border_bottom = 0;
591 } 598 }
592 } 599 }
@@ -721,7 +728,8 @@ static void arrange_windows_r(swayc_t *container, double width, double height) {
721 return; 728 return;
722 case C_OUTPUT: 729 case C_OUTPUT:
723 { 730 {
724 struct wlc_size resolution = *wlc_output_get_resolution(container->handle); 731 struct wlc_size resolution;
732 output_get_scaled_size(container->handle, &resolution);
725 width = resolution.w; height = resolution.h; 733 width = resolution.w; height = resolution.h;
726 // output must have correct size due to e.g. seamless mouse, 734 // output must have correct size due to e.g. seamless mouse,
727 // but a workspace might be smaller depending on panels. 735 // but a workspace might be smaller depending on panels.