From: Michael Stapelberg Date: Thu, 26 Nov 2009 21:17:38 +0000 (+0100) Subject: Bugfix: Fix two problems in resizing floating windows with right mouse button (Thanks... X-Git-Tag: 3.e~6^2~218 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ec2e5e83645b2c9bb6ca654946094bfa8d1491b1;p=i3%2Fi3 Bugfix: Fix two problems in resizing floating windows with right mouse button (Thanks Mirko) Minimum width/height was not consistent with the limit for grabbing and resizing a window at its border. If one of both was violated (width < min_width for example), none of them were updated. --- diff --git a/src/floating.c b/src/floating.c index b79c0756..4177b6e5 100644 --- a/src/floating.c +++ b/src/floating.c @@ -271,13 +271,13 @@ void floating_resize_window(xcb_connection_t *conn, Client *client, xcb_button_p void resize_window_callback(Rect *old_rect, uint32_t new_x, uint32_t new_y) { int32_t new_width = old_rect->width + (new_x - event->root_x); int32_t new_height = old_rect->height + (new_y - event->root_y); - /* Obey minimum window size */ - if (new_width < 75 || new_height < 50) - return; - /* Reposition the client correctly while moving */ - client->rect.width = new_width; - client->rect.height = new_height; + /* Obey minimum window size and reposition the client */ + if (new_width >= 50) + client->rect.width = new_width; + + if (new_height >= 20) + client->rect.height = new_height; /* resize_client flushes */ resize_client(conn, client);