summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authornicm <nicm>2021-08-13 06:52:51 +0000
committernicm <nicm>2021-08-13 06:52:51 +0000
commit2bb0b9d6c5edd7c4127c971f5ccebed969f86c1c (patch)
treedc1ce41c165065e588de274dd754113bd0cb8a3f /input.c
parenta2b85069171413aa30c812d44bf8ee4d32a2f834 (diff)
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 'input.c')
-rw-r--r--input.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/input.c b/input.c
index 49ed68b7..155144b7 100644
--- a/input.c
+++ b/input.c
@@ -1792,8 +1792,12 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx)
if (sctx->s->mode & MODE_FOCUSON)
break;
screen_write_mode_set(sctx, MODE_FOCUSON);
- if (wp != NULL)
- wp->flags |= PANE_FOCUSPUSH; /* force update */
+ if (wp == NULL)
+ break;
+ if (wp->flags & PANE_FOCUSED)
+ bufferevent_write(wp->event, "\033[I", 3);
+ else
+ bufferevent_write(wp->event, "\033[O", 3);
break;
case 1005:
screen_write_mode_set(sctx, MODE_MOUSE_UTF8);