diff options
author | MC <mc@hack.org> | 2010-07-09 11:16:43 +0200 |
---|---|---|
committer | MC <mc@hack.org> | 2010-07-09 11:16:43 +0200 |
commit | 16dcfef443d6f0a6f0e6829f077064ae2db75351 (patch) | |
tree | 32aa30959b53aa6899b4ab367fb0b0022de1db76 /mcwm.c | |
parent | 2cfba8ebcad3b8ef4f226de900b45203d042bea1 (diff) | |
download | mcwm-16dcfef443d6f0a6f0e6829f077064ae2db75351.zip |
Fixed bug when we could resize a bit outside the root window.
Diffstat (limited to 'mcwm.c')
-rw-r--r-- | mcwm.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -1369,8 +1369,8 @@ void mouseresize(xcb_drawable_t win, int rel_x, int rel_y) { xcb_get_geometry_reply_t *geom; xcb_size_hints_t hints; - uint32_t width; - uint32_t height; + int32_t width; + int32_t height; uint32_t width_inc = 1; uint32_t height_inc = 1; @@ -1417,6 +1417,8 @@ void mouseresize(xcb_drawable_t win, int rel_x, int rel_y) * width and height in reporting window sizes to users. If a * base size is not provided, the minimum size is to be used in * its place and vice versa. + * + * FIXME: This should be in the struct client. */ if (!xcb_get_wm_normal_hints_reply( conn, xcb_get_wm_normal_hints_unchecked(conn, win), &hints, NULL)) @@ -1450,14 +1452,14 @@ void mouseresize(xcb_drawable_t win, int rel_x, int rel_y) } } - if (width > screen->width_in_pixels) + if (geom->x + width > screen->width_in_pixels - BORDERWIDTH * 2) { - width = (screen->width_in_pixels - geom->x) / width_inc; + width = screen->width_in_pixels - (geom->x + BORDERWIDTH * 2); } - if (height > screen->height_in_pixels) + if (geom->y + height > screen->height_in_pixels - BORDERWIDTH * 2) { - height = (screen->height_in_pixels - geom->y) / height_inc; + height = screen->height_in_pixels - (geom->y + BORDERWIDTH * 2); } PDEBUG("Resizing to %dx%d (%dx%d)\n", width, height, |