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
This commit is contained in:
Stivvo 2021-02-14 18:52:47 +01:00
parent 13b853d96a
commit 807b2ad2d6

4
dwl.c
View File

@ -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,