Remove goto render (easier merge)

This commit is contained in:
Stivvo 2020-12-24 00:34:33 +01:00
parent fcc869ed84
commit 86ba4c8526

33
dwl.c
View file

@ -1241,27 +1241,26 @@ renderclients(Monitor *m, struct timespec *now)
ox = c->geom.x, oy = c->geom.y; ox = c->geom.x, oy = c->geom.y;
wlr_output_layout_output_coords(output_layout, m->wlr_output, wlr_output_layout_output_coords(output_layout, m->wlr_output,
&ox, &oy); &ox, &oy);
if (c->bw == 0)
goto render;
w = surface->current.width; if (c->bw) {
h = surface->current.height; w = surface->current.width;
borders = (struct wlr_box[4]) { h = surface->current.height;
{ox, oy, w + 2 * c->bw, c->bw}, /* top */ borders = (struct wlr_box[4]) {
{ox, oy + c->bw, c->bw, h}, /* left */ {ox, oy, w + 2 * c->bw, c->bw}, /* top */
{ox + c->bw + w, oy + c->bw, c->bw, h}, /* right */ {ox, oy + c->bw, c->bw, h}, /* left */
{ox, oy + c->bw + h, w + 2 * c->bw, c->bw}, /* bottom */ {ox + c->bw + w, oy + c->bw, c->bw, h}, /* right */
}; {ox, oy + c->bw + h, w + 2 * c->bw, c->bw}, /* bottom */
};
/* Draw window borders */ /* Draw window borders */
color = (c == sel) ? focuscolor : bordercolor; color = (c == sel) ? focuscolor : bordercolor;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
scalebox(&borders[i], m->wlr_output->scale); scalebox(&borders[i], m->wlr_output->scale);
wlr_render_rect(drw, &borders[i], color, wlr_render_rect(drw, &borders[i], color,
m->wlr_output->transform_matrix); m->wlr_output->transform_matrix);
}
} }
render:
/* This calls our render function for each surface among the /* This calls our render function for each surface among the
* xdg_surface's toplevel and popups. */ * xdg_surface's toplevel and popups. */
rdata.output = m->wlr_output; rdata.output = m->wlr_output;