From 72a7d78a1a7926a207539eb50f44b2e1eb089d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Thu, 5 Oct 2023 22:13:56 -0600 Subject: [PATCH] make the borders red borders for urgent clients iirc this is the same behavior of dwm --- config.def.h | 1 + dwl.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/config.def.h b/config.def.h index f4c3cae..895284f 100644 --- a/config.def.h +++ b/config.def.h @@ -9,6 +9,7 @@ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will static const unsigned int borderpx = 1; /* border pixel of windows */ static const float bordercolor[] = COLOR(0x444444ff); static const float focuscolor[] = COLOR(0x005577ff); +static const float urgentcolor[] = COLOR(0xff0000ff); /* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can also use glsl colors */ diff --git a/dwl.c b/dwl.c index b51614d..87f0636 100644 --- a/dwl.c +++ b/dwl.c @@ -2589,10 +2589,14 @@ urgent(struct wl_listener *listener, void *data) { struct wlr_xdg_activation_v1_request_activate_event *event = data; Client *c = NULL; + int i; toplevel_from_wlr_surface(event->surface, &c, NULL); if (!c || c == focustop(selmon)) return; + for (i = 0; i < 4; i++) + wlr_scene_rect_set_color(c->border[i], urgentcolor); + c->isurgent = 1; printstatus(); } @@ -2752,9 +2756,13 @@ void sethints(struct wl_listener *listener, void *data) { Client *c = wl_container_of(listener, c, set_hints); + int i; if (c == focustop(selmon)) return; + for (i = 0; i < 4; i++) + wlr_scene_rect_set_color(c->border[i], urgentcolor); + c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints); printstatus(); }