win: fix focuse tracking

Call win_on_focus_change on previous focused window too.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-05-24 23:34:30 +01:00
parent a2dab52334
commit 57f4a99940
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 4 additions and 0 deletions

View File

@ -1369,9 +1369,13 @@ void win_set_focused(session_t *ps, struct managed_win *w) {
return; return;
} }
auto old_active_win = ps->active_win;
ps->active_win = w; ps->active_win = w;
assert(win_is_focused_real(ps, w)); assert(win_is_focused_real(ps, w));
if (old_active_win) {
win_on_focus_change(ps, old_active_win);
}
win_on_focus_change(ps, w); win_on_focus_change(ps, w);
} }