Allow borderpx=0

Avoids crashing with the error dwl: render/wlr_renderer.c:102:
wlr_render_rect: Assertion `box->width > 0 && box->height > 0' failed.
This commit is contained in:
Guido Cella 2020-08-27 08:39:26 +02:00
parent 44ef698d6e
commit 57e3ce37f3

2
dwl.c
View File

@ -1184,6 +1184,7 @@ renderclients(Monitor *m, struct timespec *now)
&ox, &oy);
w = surface->current.width;
h = surface->current.height;
if (c->bw) {
borders = (struct wlr_box[4]) {
{ox, oy, w + 2 * c->bw, c->bw}, /* top */
{ox, oy + c->bw, c->bw, h}, /* left */
@ -1198,6 +1199,7 @@ renderclients(Monitor *m, struct timespec *now)
wlr_render_rect(drw, &borders[i], color,
m->wlr_output->transform_matrix);
}
}
/* This calls our render function for each surface among the
* xdg_surface's toplevel and popups. */