diff options
author | nicm <nicm> | 2016-11-23 17:01:24 +0000 |
---|---|---|
committer | nicm <nicm> | 2016-11-23 17:01:24 +0000 |
commit | 6de466cf8b665d8725301307c57f6d8cb2e65a3f (patch) | |
tree | 009c808ba29641f5c0b7bfbb17917be011cfaab2 /server-client.c | |
parent | 24916f2f6e4480143f0de026a727cc524fb797a8 (diff) | |
download | rtmux-6de466cf8b665d8725301307c57f6d8cb2e65a3f.tar.gz rtmux-6de466cf8b665d8725301307c57f6d8cb2e65a3f.tar.bz2 rtmux-6de466cf8b665d8725301307c57f6d8cb2e65a3f.zip |
For mouse keys, use the mouse pane as the default current pane.
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/server-client.c b/server-client.c index e2d1c5d9..fbe14e82 100644 --- a/server-client.c +++ b/server-client.c @@ -692,6 +692,7 @@ server_client_handle_key(struct client *c, key_code key) struct key_table *table; struct key_binding bd_find, *bd; int xtimeout; + struct cmd_find_state fs; /* Check the client is good to accept input. */ if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0) @@ -804,8 +805,21 @@ retry: } server_status_client(c); + /* Find default state if the pane is known. */ + cmd_find_clear_state(&fs, NULL, 0); + if (wp != NULL) { + fs.s = s; + fs.wl = fs.s->curw; + fs.w = fs.wl->window; + fs.wp = wp; + cmd_find_log_state(__func__, &fs); + + if (!cmd_find_valid_state(&fs)) + fatalx("invalid key state"); + } + /* Dispatch the key binding. */ - key_bindings_dispatch(bd, c, m); + key_bindings_dispatch(bd, c, m, &fs); key_bindings_unref_table(table); return; } |