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. --- tty-keys.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tty-keys.c') diff --git a/tty-keys.c b/tty-keys.c index 02fba0e5..156fceba 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -821,11 +821,13 @@ complete_key: /* Check for focus events. */ if (key == KEYC_FOCUS_OUT) { - tty->client->flags &= ~CLIENT_FOCUSED; + c->flags &= ~CLIENT_FOCUSED; + window_update_focus(c->session->curw->window); notify_client("client-focus-out", c); } else if (key == KEYC_FOCUS_IN) { - tty->client->flags |= CLIENT_FOCUSED; + c->flags |= CLIENT_FOCUSED; notify_client("client-focus-in", c); + window_update_focus(c->session->curw->window); } /* Fire the key. */ -- cgit From 13a0da205b8c24995de11776b93244e914e4694d Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 13 Aug 2021 07:37:58 +0000 Subject: Break message type stuff out into its own header. --- tty-keys.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tty-keys.c') diff --git a/tty-keys.c b/tty-keys.c index 156fceba..6dfa70f3 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -58,6 +58,17 @@ static int tty_keys_device_attributes(struct tty *, const char *, size_t, static int tty_keys_extended_device_attributes(struct tty *, const char *, size_t, size_t *); +/* A key tree entry. */ +struct tty_key { + char ch; + key_code key; + + struct tty_key *left; + struct tty_key *right; + + struct tty_key *next; +}; + /* Default raw keys. */ struct tty_default_key_raw { const char *string; -- cgit