diff options
author | nicm <nicm> | 2018-07-04 12:25:26 +0000 |
---|---|---|
committer | nicm <nicm> | 2018-07-04 12:25:26 +0000 |
commit | d254293a6d406db4b1d1d4cac36cd4225fa0d8a7 (patch) | |
tree | f4550ab8fce8034fd2c6e31a711750565154104f /server-client.c | |
parent | 2fae6a57618e1cef47b65e73504d7d5570ca6a8e (diff) |
Add pane focus hooks.
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/server-client.c b/server-client.c index 6a94bb56..cec305f0 100644 --- a/server-client.c +++ b/server-client.c @@ -1148,10 +1148,6 @@ server_client_check_focus(struct window_pane *wp) push = wp->flags & PANE_FOCUSPUSH; wp->flags &= ~PANE_FOCUSPUSH; - /* If we don't care about focus, forget it. */ - if (!(wp->base.mode & MODE_FOCUSON)) - return; - /* If we're not the active pane in our window, we're not focused. */ if (wp->window->active != wp) goto not_focused; @@ -1175,14 +1171,20 @@ server_client_check_focus(struct window_pane *wp) } not_focused: - if (push || (wp->flags & PANE_FOCUSED)) - bufferevent_write(wp->event, "\033[O", 3); + if (push || (wp->flags & PANE_FOCUSED)) { + if (wp->base.mode & MODE_FOCUSON) + bufferevent_write(wp->event, "\033[O", 3); + notify_pane("pane-focus-out", wp); + } wp->flags &= ~PANE_FOCUSED; return; focused: - if (push || !(wp->flags & PANE_FOCUSED)) - bufferevent_write(wp->event, "\033[I", 3); + if (push || !(wp->flags & PANE_FOCUSED)) { + if (wp->base.mode & MODE_FOCUSON) + bufferevent_write(wp->event, "\033[I", 3); + notify_pane("pane-focus-in", wp); + } wp->flags |= PANE_FOCUSED; } |