mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-09-19 05:42:49 +00:00
size hints can be -1
This commit is contained in:
@@ -248,12 +248,12 @@ client_is_float_type(Client *c)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return min.width && min.height &&
|
return min.width > 0 && min.height > 0 &&
|
||||||
(min.width == max.width || min.height == max.height);
|
(min.width == max.width || min.height == max.height);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return c->surface.xdg->toplevel->parent || (min.width && min.height &&
|
return c->surface.xdg->toplevel->parent || (min.width > 0 && min.height > 0 &&
|
||||||
(min.width == max.width || min.height == max.height));
|
(min.width == max.width || min.height == max.height));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -491,9 +491,9 @@ applybounds(Client *c, struct wlr_box *bbox)
|
|||||||
c->geom.height = MAX(min.height + 2 * (int)c->bw, c->geom.height);
|
c->geom.height = MAX(min.height + 2 * (int)c->bw, c->geom.height);
|
||||||
/* Some clients set their max size to INT_MAX, which does not violate the
|
/* Some clients set their max size to INT_MAX, which does not violate the
|
||||||
* protocol but it's unnecesary, as they can set their max size to zero. */
|
* protocol but it's unnecesary, as they can set their max size to zero. */
|
||||||
if (max.width && 2 * (int)c->bw <= INT_MAX - max.width) /* Checks for overflow */
|
if (max.width > 0 && 2 * (int)c->bw <= INT_MAX - max.width) /* Checks for overflow */
|
||||||
c->geom.width = MIN(max.width + 2 * (int)c->bw, c->geom.width);
|
c->geom.width = MIN(max.width + 2 * (int)c->bw, c->geom.width);
|
||||||
if (max.height && 2 * (int)c->bw <= INT_MAX - max.height) /* Checks for overflow */
|
if (max.height > 0 && 2 * (int)c->bw <= INT_MAX - max.height) /* Checks for overflow */
|
||||||
c->geom.height = MIN(max.height + 2 * (int)c->bw, c->geom.height);
|
c->geom.height = MIN(max.height + 2 * (int)c->bw, c->geom.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user