aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStivvo <stivvo01@gmail.com>2020-12-24 00:34:33 +0100
committerStivvo <stivvo01@gmail.com>2020-12-24 00:34:33 +0100
commit86ba4c8526d8b96eb0caaa60f8f42edb51b2b558 (patch)
tree76191b054757abc68735755abe602fb83d9c667b
parentfcc869ed8480c21cd8b36d9fc3bd8dd3b8cee981 (diff)
Remove goto render (easier merge)
-rw-r--r--dwl.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/dwl.c b/dwl.c
index 1a26ab6..8e1e384 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1241,27 +1241,26 @@ renderclients(Monitor *m, struct timespec *now)
ox = c->geom.x, oy = c->geom.y;
wlr_output_layout_output_coords(output_layout, m->wlr_output,
&ox, &oy);
- if (c->bw == 0)
- goto render;
-
- w = surface->current.width;
- h = surface->current.height;
- borders = (struct wlr_box[4]) {
- {ox, oy, w + 2 * c->bw, c->bw}, /* top */
- {ox, oy + c->bw, c->bw, h}, /* left */
- {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 */
- color = (c == sel) ? focuscolor : bordercolor;
- for (i = 0; i < 4; i++) {
- scalebox(&borders[i], m->wlr_output->scale);
- wlr_render_rect(drw, &borders[i], color,
- m->wlr_output->transform_matrix);
+
+ if (c->bw) {
+ w = surface->current.width;
+ h = surface->current.height;
+ borders = (struct wlr_box[4]) {
+ {ox, oy, w + 2 * c->bw, c->bw}, /* top */
+ {ox, oy + c->bw, c->bw, h}, /* left */
+ {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 */
+ color = (c == sel) ? focuscolor : bordercolor;
+ for (i = 0; i < 4; i++) {
+ scalebox(&borders[i], m->wlr_output->scale);
+ wlr_render_rect(drw, &borders[i], color,
+ m->wlr_output->transform_matrix);
+ }
}
-render:
/* This calls our render function for each surface among the
* xdg_surface's toplevel and popups. */
rdata.output = m->wlr_output;