From 807b2ad2d64dc563eacc47448239a3a3f837fdf3 Mon Sep 17 00:00:00 2001 From: Stivvo Date: Sun, 14 Feb 2021 18:52:47 +0100 Subject: [PATCH] Fix crash on xwayland (toplevel->activated) Xwayland clients don't have the same structure. The toplevel->current.activated thing was meant to avoid selclient() in render, but that would require a separate check for xwayland clients, so it isn't worth it any more --- dwl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index 85c4e1a..fa83396 100644 --- a/dwl.c +++ b/dwl.c @@ -1642,7 +1642,7 @@ render(struct wlr_surface *surface, int sx, int sy, void *data) void renderclients(Monitor *m, struct timespec *now) { - Client *c; + Client *c, *sel = selclient(); const float *color; double ox, oy; int i, w, h; @@ -1673,7 +1673,7 @@ renderclients(Monitor *m, struct timespec *now) }; /* Draw window borders */ - color = (c->surface.xdg->toplevel->current.activated) ? focuscolor : bordercolor; + 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,