diff options
| author | Leonardo Hernández Hernández <leohdz172@protonmail.com> | 2022-06-24 19:15:24 -0500 | 
|---|---|---|
| committer | Leonardo Hernández Hernández <leohdz172@protonmail.com> | 2022-06-24 19:19:20 -0500 | 
| commit | 72e0a560d9836c5e8658003f548203bcd722e565 (patch) | |
| tree | 8365d63c2f68b53084998b485dc23359b334f1cc /dwl.c | |
| parent | 2aa391361c877f3319050e57c828e065a61d9d85 (diff) | |
respect size hints
Diffstat (limited to 'dwl.c')
| -rw-r--r-- | dwl.c | 18 | 
1 files changed, 11 insertions, 7 deletions
| @@ -381,9 +381,15 @@ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };  void  applybounds(Client *c, struct wlr_box *bbox)  { -	/* set minimum possible */ -	c->geom.width = MAX(1, c->geom.width); -	c->geom.height = MAX(1, c->geom.height); +	struct wlr_box min = {0}, max = {0}; +	client_get_size_hints(c, &max, &min); +	/* try to set size hints */ +	c->geom.width = MAX(min.width + (2 * c->bw), c->geom.width); +	c->geom.height = MAX(min.height + (2 * c->bw), c->geom.height); +	if (max.width > 0) +		c->geom.width = MIN(max.width + (2 * c->bw), c->geom.width); +	if (max.height > 0) +		c->geom.height = MIN(max.height + (2 * c->bw), c->geom.height);  	if (c->geom.x >= bbox->x + bbox->width)  		c->geom.x = bbox->x + bbox->width - c->geom.width; @@ -1721,13 +1727,11 @@ requeststartdrag(struct wl_listener *listener, void *data)  void  resize(Client *c, int x, int y, int w, int h, int interact)  { -	int min_width = 0, min_height = 0;  	struct wlr_box *bbox = interact ? &sgeom : &c->mon->w; -	client_min_size(c, &min_width, &min_height);  	c->geom.x = x;  	c->geom.y = y; -	c->geom.width = MAX(min_width + 2 * c->bw, w); -	c->geom.height = MAX(min_height + 2 * c->bw, h); +	c->geom.width = w; +	c->geom.height = h;  	applybounds(c, bbox);  	/* Update scene-graph, including borders */ | 
