make sure the ConfigureNotify is propogated even when there is no change

This commit is contained in:
Dana Jansens 2003-03-24 20:15:36 +00:00
parent c9ba604668
commit c2684d312b

View file

@ -1319,63 +1319,61 @@ void client_configure(Client *self, Corner anchor, int x, int y, int w, int h,
} }
} }
if (x == self->area.x && y == self->area.y && w == self->area.width && if (!(w == self->area.width && h == self->area.height)) {
h == self->area.height) w -= self->base_size.width;
return; /* no change */ h -= self->base_size.height;
w -= self->base_size.width; if (user) {
h -= self->base_size.height; /* for interactive resizing. have to move half an increment in each
direction. */
if (user) { /* how far we are towards the next size inc */
/* for interactive resizing. have to move half an increment in each int mw = w % self->size_inc.width;
direction. */ int mh = h % self->size_inc.height;
/* amount to add */
/* how far we are towards the next size inc */ int aw = self->size_inc.width / 2;
int mw = w % self->size_inc.width; int ah = self->size_inc.height / 2;
int mh = h % self->size_inc.height; /* don't let us move into a new size increment */
/* amount to add */ if (mw + aw >= self->size_inc.width)
int aw = self->size_inc.width / 2; aw = self->size_inc.width - mw - 1;
int ah = self->size_inc.height / 2; if (mh + ah >= self->size_inc.height)
/* don't let us move into a new size increment */ ah = self->size_inc.height - mh - 1;
if (mw + aw >= self->size_inc.width) w += aw;
aw = self->size_inc.width - mw - 1; h += ah;
if (mh + ah >= self->size_inc.height)
ah = self->size_inc.height - mh - 1;
w += aw;
h += ah;
/* if this is a user-requested resize, then check against min/max /* if this is a user-requested resize, then check against min/max
sizes and aspect ratios */ sizes and aspect ratios */
/* smaller than min size or bigger than max size? */ /* smaller than min size or bigger than max size? */
if (w > self->max_size.width) w = self->max_size.width; if (w > self->max_size.width) w = self->max_size.width;
if (w < self->min_size.width) w = self->min_size.width; if (w < self->min_size.width) w = self->min_size.width;
if (h > self->max_size.height) h = self->max_size.height; if (h > self->max_size.height) h = self->max_size.height;
if (h < self->min_size.height) h = self->min_size.height; if (h < self->min_size.height) h = self->min_size.height;
/* adjust the height ot match the width for the aspect ratios */ /* adjust the height ot match the width for the aspect ratios */
if (self->min_ratio) if (self->min_ratio)
if (h * self->min_ratio > w) h = (int)(w / self->min_ratio); if (h * self->min_ratio > w) h = (int)(w / self->min_ratio);
if (self->max_ratio) if (self->max_ratio)
if (h * self->max_ratio < w) h = (int)(w / self->max_ratio); if (h * self->max_ratio < w) h = (int)(w / self->max_ratio);
} }
/* keep to the increments */ /* keep to the increments */
w /= self->size_inc.width; w /= self->size_inc.width;
h /= self->size_inc.height; h /= self->size_inc.height;
/* you cannot resize to nothing */ /* you cannot resize to nothing */
if (w < 1) w = 1; if (w < 1) w = 1;
if (h < 1) h = 1; if (h < 1) h = 1;
/* store the logical size */ /* store the logical size */
SIZE_SET(self->logical_size, w, h); SIZE_SET(self->logical_size, w, h);
w *= self->size_inc.width; w *= self->size_inc.width;
h *= self->size_inc.height; h *= self->size_inc.height;
w += self->base_size.width; w += self->base_size.width;
h += self->base_size.height; h += self->base_size.height;
}
switch (anchor) { switch (anchor) {
case Corner_TopLeft: case Corner_TopLeft: