add colors for sticky patch

This commit is contained in:
korei999 2023-11-29 22:41:38 +02:00
parent 34ac3849c3
commit 7208380841

19
dwl.c
View file

@ -1496,9 +1496,14 @@ focusclient(Client *c, int lift)
/* Don't change border color if there is an exclusive focus or we are
* handling a drag operation */
if (!exclusive_focus && !seat->drag)
if (!exclusive_focus && !seat->drag) {
if (c->issticky) {
client_set_border_color(c, mixedcolor);
}
else
client_set_border_color(c, focuscolor);
}
}
/* Deactivate old client if focus is changing */
if (old && (!c || client_surface(c) != old)) {
@ -1514,6 +1519,9 @@ focusclient(Client *c, int lift)
/* Don't deactivate old client if the new one wants focus, as this causes issues with winecfg
* and probably other clients */
} else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
if (old_c->issticky)
client_set_border_color(old_c, stickycolor);
else
client_set_border_color(old_c, bordercolor);
client_activate_surface(old, 0);
@ -2884,6 +2892,15 @@ togglesticky(const Arg *arg)
if (!sel)
return;
sel->issticky = !sel->issticky;
if (sel->issticky) {
client_set_border_color(sel, mixedcolor);
} else {
client_set_border_color(sel, focuscolor);
if (!VISIBLEON(sel, selmon))
focusclient(focustop(selmon, 0), 1);
}
arrange(selmon);
}