From 887fde65a3010905aa10f373cfcfe540cfc1781e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Mon, 9 Oct 2023 22:16:52 -0600 Subject: [PATCH 1/2] only set border color for urgent *and* mapped X11 clients this fixes a segfault when the client emits .set_hints but it's not mapped Fixes: 72a7d78a1a7926a207539eb50f44b2e1eb089d49 --- dwl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dwl.c b/dwl.c index e07560e..edc7337 100644 --- a/dwl.c +++ b/dwl.c @@ -2756,8 +2756,11 @@ sethints(struct wl_listener *listener, void *data) if (c == focustop(selmon)) return; - client_set_border_color(c, urgentcolor); c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints); + + if (c->isurgent && client_is_mapped(c)) + client_set_border_color(c, urgentcolor); + printstatus(); } From df131cdb78c6e3e79c3fafa522f0e4f6b43d2ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Mon, 9 Oct 2023 21:35:49 -0600 Subject: [PATCH 2/2] use instead of --- dwl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dwl.c b/dwl.c index edc7337..4cfa4db 100644 --- a/dwl.c +++ b/dwl.c @@ -54,7 +54,7 @@ #include #ifdef XWAYLAND #include -#include +#include #include #endif @@ -398,13 +398,13 @@ static struct wl_listener session_lock_mgr_destroy = {.notify = destroysessionmg static void activatex11(struct wl_listener *listener, void *data); static void configurex11(struct wl_listener *listener, void *data); static void createnotifyx11(struct wl_listener *listener, void *data); -static Atom getatom(xcb_connection_t *xc, const char *name); +static xcb_atom_t getatom(xcb_connection_t *xc, const char *name); static void sethints(struct wl_listener *listener, void *data); static void xwaylandready(struct wl_listener *listener, void *data); static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11}; static struct wl_listener xwayland_ready = {.notify = xwaylandready}; static struct wlr_xwayland *xwayland; -static Atom netatom[NetLast]; +static xcb_atom_t netatom[NetLast]; #endif /* configuration, allows nested code to access above variables */ @@ -2736,10 +2736,10 @@ createnotifyx11(struct wl_listener *listener, void *data) LISTEN(&xsurface->events.request_fullscreen, &c->fullscreen, fullscreennotify); } -Atom +xcb_atom_t getatom(xcb_connection_t *xc, const char *name) { - Atom atom = 0; + xcb_atom_t atom = 0; xcb_intern_atom_reply_t *reply; xcb_intern_atom_cookie_t cookie = xcb_intern_atom(xc, 0, strlen(name), name); if ((reply = xcb_intern_atom_reply(xc, cookie, NULL)))