From d06ea7dcb8d51bf7cff3800dcfcd7ae852e3cb7f Mon Sep 17 00:00:00 2001 From: Squibid Date: Tue, 11 Feb 2025 15:45:12 -0600 Subject: add colored borders --- client.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'client.h') diff --git a/client.h b/client.h index f1e2ab5..74ddd2a 100644 --- a/client.h +++ b/client.h @@ -314,8 +314,24 @@ static inline void client_set_border_color(Client *c, const float color[static 4]) { int i; - for (i = 0; i < 4; i++) - wlr_scene_rect_set_color(c->border[i], color); + + if (!c) + return; + + if (c == focustop(selmon)) { + if (selmon->lt[selmon->sellt] == (Layout*)&layouts[1] || c->isfloating) + color = floatcolor; + else if (selmon->lt[selmon->sellt] == (Layout*)&layouts[2]) + color = monoclecolor; + else if (c->isurgent && client_is_mapped(c)) + color = urgentcolor; + else if (!exclusive_focus && !seat->drag) + color = focuscolor; + } else + color = color; + + for (i = 0; i < 4; i++) + wlr_scene_rect_set_color(c->border[i], color); } static inline void -- cgit v1.2.1