diff options
author | nicm <nicm> | 2021-08-13 06:52:51 +0000 |
---|---|---|
committer | nicm <nicm> | 2021-08-13 06:52:51 +0000 |
commit | 2bb0b9d6c5edd7c4127c971f5ccebed969f86c1c (patch) | |
tree | dc1ce41c165065e588de274dd754113bd0cb8a3f /session.c | |
parent | a2b85069171413aa30c812d44bf8ee4d32a2f834 (diff) | |
download | rtmux-2bb0b9d6c5edd7c4127c971f5ccebed969f86c1c.tar.gz rtmux-2bb0b9d6c5edd7c4127c971f5ccebed969f86c1c.tar.bz2 rtmux-2bb0b9d6c5edd7c4127c971f5ccebed969f86c1c.zip |
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.
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -489,6 +489,8 @@ session_last(struct session *s) int session_set_current(struct session *s, struct winlink *wl) { + struct winlink *old = s->curw; + if (wl == NULL) return (-1); if (wl == s->curw) @@ -497,6 +499,10 @@ session_set_current(struct session *s, struct winlink *wl) winlink_stack_remove(&s->lastw, wl); winlink_stack_push(&s->lastw, s->curw); s->curw = wl; + if (options_get_number(global_options, "focus-events")) { + window_update_focus(old->window); + window_update_focus(wl->window); + } winlink_clear_flags(wl); window_update_activity(wl->window); tty_update_window_offset(wl->window); |