cap the client (and frame) window's dimensions at the range of an unsigned short (bug #4596)

This commit is contained in:
Dana Jansens 2010-10-20 15:30:29 -04:00
parent 9c4ef9aa4a
commit 4e3ffbfc28

View file

@ -2874,6 +2874,13 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
the updated frame dimensions. */
frame_adjust_area(self->frame, FALSE, TRUE, TRUE);
/* cap any X windows at the size of an unsigned short */
*w = MIN(*w,
G_MAXUSHORT - self->frame->size.left - self->frame->size.right);
*h = MIN(*h,
G_MAXUSHORT - self->frame->size.top - self->frame->size.bottom);
/* gets the frame's position */
frame_client_gravity(self->frame, x, y);