From 9f0fa0845bd7ea80920a99b2a30eb697396403a1 Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Sat, 4 Jun 2011 15:47:02 +0200 Subject: Take output coordinates into consideration when resizing with limits. --- mcwm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mcwm.c b/mcwm.c index 7282514..20636bc 100644 --- a/mcwm.c +++ b/mcwm.c @@ -2191,14 +2191,14 @@ void resizelim(struct client *client) client->width = client->min_width; } - if (client->x + client->width > mon_width) + if (client->x + client->width + BORDERWIDTH * 2 > mon_x + mon_width) { - client->width = mon_width - (client->x + BORDERWIDTH * 2); + client->width = mon_width - ((client->x - mon_x) + BORDERWIDTH * 2); } - - if (client->y + client->height > mon_height) + + if (client->y + client->height + BORDERWIDTH * 2 > mon_y + mon_height) { - client->height = mon_height - (client->y + BORDERWIDTH * 2); + client->height = mon_height - ((client->y - mon_y) + BORDERWIDTH * 2); } resize(client->id, client->width, client->height); @@ -2214,6 +2214,8 @@ void resize(xcb_drawable_t win, uint16_t width, uint16_t height) /* Can't resize root. */ return; } + + PDEBUG("Resizing to %d x %d.\n", width, height); values[0] = width; values[1] = height; -- cgit v1.2.3