summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2010-07-23 16:27:09 +0200
committerMichael Cardell Widerkrantz <mc@hack.org>2010-07-23 16:27:09 +0200
commitb996ffa9da9a9d532177a44f0ef0b73feace0a66 (patch)
treefca778dc62a00529a557a72652a65562b196ecee /mcwm.c
parent8b7eccc50795ad9d6a261fca54fabf7a861b22b5 (diff)
downloadmcwm-b996ffa9da9a9d532177a44f0ef0b73feace0a66.zip
Oops. Check for min_width in mouseresize() as well.
Add check for minimum size when resizing by keyboard.
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c18
1 files changed, 17 insertions, 1 deletions
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)
{