From 57daffa5cef5fb5bfbabc7fdd7ccffacc7c58041 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Tue, 7 May 2024 19:59:14 +0200 Subject: [PATCH] Make sure whole client is inside of bounds in applybounds --- dwl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dwl.c b/dwl.c index 752e66d..82ce08f 100644 --- a/dwl.c +++ b/dwl.c @@ -432,13 +432,13 @@ applybounds(Client *c, struct wlr_box *bbox) c->geom.width = MAX(1 + 2 * (int)c->bw, c->geom.width); c->geom.height = MAX(1 + 2 * (int)c->bw, c->geom.height); - if (c->geom.x >= bbox->x + bbox->width) + if (c->geom.x + c->geom.width >= bbox->x + bbox->width) c->geom.x = bbox->x + bbox->width - c->geom.width; - if (c->geom.y >= bbox->y + bbox->height) + if (c->geom.y + c->geom.height >= bbox->y + bbox->height) c->geom.y = bbox->y + bbox->height - c->geom.height; - if (c->geom.x + c->geom.width + 2 * (int)c->bw <= bbox->x) + if (c->geom.x < bbox->x) c->geom.x = bbox->x; - if (c->geom.y + c->geom.height + 2 * (int)c->bw <= bbox->y) + if (c->geom.y < bbox->y) c->geom.y = bbox->y; } @@ -2054,7 +2054,7 @@ requestmonstate(struct wl_listener *listener, void *data) void resize(Client *c, struct wlr_box geo, int interact) { - struct wlr_box *bbox = interact ? &sgeom : &c->mon->w; + struct wlr_box *bbox = interact ? &sgeom : &c->mon->m; struct wlr_box clip; client_set_bounds(c, geo.width, geo.height); c->geom = geo; -- 2.48.1