From 2bb0b9d6c5edd7c4127c971f5ccebed969f86c1c Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 13 Aug 2021 06:52:51 +0000 Subject: 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. --- input.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'input.c') 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); -- cgit