fix: miss re judge the border corler of old mon sel client after change focus mon

This commit is contained in:
DreamMaoMao 2025-09-22 11:57:52 +08:00
parent b6b56a91ef
commit cddbbd8bd6

View file

@ -131,7 +131,7 @@ void toggle_trackpad_enable(const Arg *arg) {
} }
void focusmon(const Arg *arg) { void focusmon(const Arg *arg) {
Client *c; Client *c, *old_selmon_sel;
Monitor *m = NULL; Monitor *m = NULL;
if (arg->i != UNDIR) { if (arg->i != UNDIR) {
@ -152,6 +152,7 @@ void focusmon(const Arg *arg) {
if (!m || !m->wlr_output->enabled) if (!m || !m->wlr_output->enabled)
return; return;
old_selmon_sel = selmon->sel;
selmon = m; selmon = m;
warp_cursor_to_selmon(selmon); warp_cursor_to_selmon(selmon);
c = focustop(selmon); c = focustop(selmon);
@ -161,6 +162,10 @@ void focusmon(const Arg *arg) {
wlr_seat_keyboard_notify_clear_focus(seat); wlr_seat_keyboard_notify_clear_focus(seat);
} else } else
focusclient(c, 1); focusclient(c, 1);
if (old_selmon_sel) {
setborder_color(old_selmon_sel);
}
} }
void // 17 void // 17