summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2018-07-04 15:02:25 +0100
committerThomas Adam <thomas@xteddy.org>2018-07-04 15:02:25 +0100
commit20154f391ea0821d4e58ce952b69e08a33209b74 (patch)
treec4dc2791ead38feeb455d5279ecdbe31f5d0862c /server-client.c
parent5c0ce192ed313c988f7d67e4911ef602a894cea0 (diff)
parent98c4291df2201271a0d70fc141cfaf744021ff35 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/server-client.c b/server-client.c
index dc84770a..94a024b0 100644
--- a/server-client.c
+++ b/server-client.c
@@ -1158,10 +1158,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;
@@ -1185,14 +1181,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;
}