diff options
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/layout.c b/sway/layout.c index 344ca647..0b498937 100644 --- a/sway/layout.c +++ b/sway/layout.c | |||
@@ -374,7 +374,7 @@ void move_workspace_to(swayc_t* workspace, swayc_t* destination) { | |||
374 | update_visibility(src_op); | 374 | update_visibility(src_op); |
375 | } | 375 | } |
376 | 376 | ||
377 | static void adjust_border_geometry(swayc_t *c, struct wlc_geometry *g, | 377 | static void adjust_border_geometry(swayc_t *c, struct wlc_geometry *g, |
378 | const struct wlc_size *res, int left, int right, int top, int bottom) { | 378 | const struct wlc_size *res, int left, int right, int top, int bottom) { |
379 | 379 | ||
380 | g->size.w += left + right; | 380 | g->size.w += left + right; |
@@ -384,7 +384,7 @@ static void adjust_border_geometry(swayc_t *c, struct wlc_geometry *g, | |||
384 | else if (g->origin.x + g->size.w - right > res->w) { | 384 | else if (g->origin.x + g->size.w - right > res->w) { |
385 | g->size.w = res->w - g->origin.x + right; | 385 | g->size.w = res->w - g->origin.x + right; |
386 | } | 386 | } |
387 | 387 | ||
388 | g->size.h += top + bottom; | 388 | g->size.h += top + bottom; |
389 | if (g->origin.y - top < 0) { | 389 | if (g->origin.y - top < 0) { |
390 | g->size.h += g->origin.y - top; | 390 | g->size.h += g->origin.y - top; |
@@ -393,15 +393,15 @@ static void adjust_border_geometry(swayc_t *c, struct wlc_geometry *g, | |||
393 | g->size.h = res->h - g->origin.y + top; | 393 | g->size.h = res->h - g->origin.y + top; |
394 | } | 394 | } |
395 | 395 | ||
396 | g->origin.x = MIN(MAX( g->origin.x - left, 0), res->w); | 396 | g->origin.x = MIN((uint32_t)MAX(g->origin.x - left, 0), res->w); |
397 | g->origin.y = MIN(MAX( g->origin.y - top, 0), res->h); | 397 | g->origin.y = MIN((uint32_t)MAX(g->origin.y - top, 0), res->h); |
398 | 398 | ||
399 | } | 399 | } |
400 | 400 | ||
401 | static void update_border_geometry_floating(swayc_t *c, struct wlc_geometry *geometry) { | 401 | static void update_border_geometry_floating(swayc_t *c, struct wlc_geometry *geometry) { |
402 | struct wlc_geometry g = *geometry; | 402 | struct wlc_geometry g = *geometry; |
403 | c->actual_geometry = g; | 403 | c->actual_geometry = g; |
404 | 404 | ||
405 | swayc_t *output = swayc_parent_by_type(c, C_OUTPUT); | 405 | swayc_t *output = swayc_parent_by_type(c, C_OUTPUT); |
406 | const struct wlc_size *res = wlc_output_get_resolution(output->handle); | 406 | const struct wlc_size *res = wlc_output_get_resolution(output->handle); |
407 | 407 | ||
@@ -409,14 +409,14 @@ static void update_border_geometry_floating(swayc_t *c, struct wlc_geometry *geo | |||
409 | case B_NONE: | 409 | case B_NONE: |
410 | break; | 410 | break; |
411 | case B_PIXEL: | 411 | case B_PIXEL: |
412 | adjust_border_geometry(c, &g, res, c->border_thickness, | 412 | adjust_border_geometry(c, &g, res, c->border_thickness, |
413 | c->border_thickness, c->border_thickness, c->border_thickness); | 413 | c->border_thickness, c->border_thickness, c->border_thickness); |
414 | break; | 414 | break; |
415 | case B_NORMAL: | 415 | case B_NORMAL: |
416 | { | 416 | { |
417 | int title_bar_height = config->font_height + 4; // borders + padding | 417 | int title_bar_height = config->font_height + 4; // borders + padding |
418 | 418 | ||
419 | adjust_border_geometry(c, &g, res, c->border_thickness, | 419 | adjust_border_geometry(c, &g, res, c->border_thickness, |
420 | c->border_thickness, title_bar_height, c->border_thickness); | 420 | c->border_thickness, title_bar_height, c->border_thickness); |
421 | 421 | ||
422 | struct wlc_geometry title_bar = { | 422 | struct wlc_geometry title_bar = { |