Change focus to be driven by events rather than walking all panes at end

of event loop, this way the ordering of in and out can be enforced.
GitHub issue 2808.
This commit is contained in:
nicm
2021-08-13 06:52:51 +00:00
parent a2b8506917
commit 2bb0b9d6c5
10 changed files with 115 additions and 122 deletions

View File

@ -821,11 +821,13 @@ complete_key:
/* Check for focus events. */
if (key == KEYC_FOCUS_OUT) {
tty->client->flags &= ~CLIENT_FOCUSED;
c->flags &= ~CLIENT_FOCUSED;
window_update_focus(c->session->curw->window);
notify_client("client-focus-out", c);
} else if (key == KEYC_FOCUS_IN) {
tty->client->flags |= CLIENT_FOCUSED;
c->flags |= CLIENT_FOCUSED;
notify_client("client-focus-in", c);
window_update_focus(c->session->curw->window);
}
/* Fire the key. */