version 1.250, 2018/05/24 09:42:49 |
version 1.251, 2018/07/04 12:25:26 |
|
|
push = wp->flags & PANE_FOCUSPUSH; |
push = wp->flags & PANE_FOCUSPUSH; |
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 we're not the active pane in our window, we're not focused. */ |
if (wp->window->active != wp) |
if (wp->window->active != wp) |
goto not_focused; |
goto not_focused; |
|
|
} |
} |
|
|
not_focused: |
not_focused: |
if (push || (wp->flags & PANE_FOCUSED)) |
if (push || (wp->flags & PANE_FOCUSED)) { |
bufferevent_write(wp->event, "\033[O", 3); |
if (wp->base.mode & MODE_FOCUSON) |
|
bufferevent_write(wp->event, "\033[O", 3); |
|
notify_pane("pane-focus-out", wp); |
|
} |
wp->flags &= ~PANE_FOCUSED; |
wp->flags &= ~PANE_FOCUSED; |
return; |
return; |
|
|
focused: |
focused: |
if (push || !(wp->flags & PANE_FOCUSED)) |
if (push || !(wp->flags & PANE_FOCUSED)) { |
bufferevent_write(wp->event, "\033[I", 3); |
if (wp->base.mode & MODE_FOCUSON) |
|
bufferevent_write(wp->event, "\033[I", 3); |
|
notify_pane("pane-focus-in", wp); |
|
} |
wp->flags |= PANE_FOCUSED; |
wp->flags |= PANE_FOCUSED; |
} |
} |
|
|