From b996ffa9da9a9d532177a44f0ef0b73feace0a66 Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Fri, 23 Jul 2010 16:27:09 +0200 Subject: Oops. Check for min_width in mouseresize() as well. Add check for minimum size when resizing by keyboard. --- mcwm.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'mcwm.c') diff --git a/mcwm.c b/mcwm.c index edfb206..d831b4f 100644 --- a/mcwm.c +++ b/mcwm.c @@ -1433,6 +1433,17 @@ void resizestep(struct client *client, char direction) break; } /* switch direction */ + /* Is it smaller than it wants to be? */ + if (0 != client->min_height && height < client->min_height) + { + height = client->min_height; + } + + if (0 != client->min_width && width < client->min_width) + { + width = client->min_width; + } + PDEBUG("Resizing to %dx%d\n", width, height); resize(win, width, height); @@ -1552,12 +1563,17 @@ void mouseresize(struct client *client, int rel_x, int rel_y) width -= (width - client->base_width) % client->width_inc; height -= (height - client->base_height) % client->height_inc; - /* Is it smaller than it says it can be? */ + /* Is it smaller than it wants to be? */ if (0 != client->min_height && height < client->min_height) { height = client->min_height; } + if (0 != client->min_width && width < client->min_width) + { + width = client->min_width; + } + /* Check if the window fits on screen. */ if (x + width > screen->width_in_pixels - BORDERWIDTH * 2) { -- cgit v1.2.3