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.
This commit is contained in:
Michael Stapelberg 2009-11-26 22:17:38 +01:00
parent 5a1668db36
commit ec2e5e8364

View File

@ -271,12 +271,12 @@ 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 */
/* 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 */