diff options
author | Thomas Adam <thomas@xteddy.org> | 2017-05-10 14:01:11 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2017-05-10 14:01:11 +0100 |
commit | f8b3f1622dcc250556599656e112a0068c75efab (patch) | |
tree | 2afc5fffaa93d551d061ba89aef1365aa730e204 /key-bindings.c | |
parent | daef51e038132157b08f37e365dd845847243462 (diff) | |
parent | 0e3c5ebe1a229fbb8d829c9413ae013fb2eeb1ed (diff) | |
download | rtmux-f8b3f1622dcc250556599656e112a0068c75efab.tar.gz rtmux-f8b3f1622dcc250556599656e112a0068c75efab.tar.bz2 rtmux-f8b3f1622dcc250556599656e112a0068c75efab.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'key-bindings.c')
-rw-r--r-- | key-bindings.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/key-bindings.c b/key-bindings.c index 9e327655..8f56cbee 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -400,11 +400,11 @@ key_bindings_read_only(struct cmdq_item *item, __unused void *data) } void -key_bindings_dispatch(struct key_binding *bd, struct client *c, - struct mouse_event *m, struct cmd_find_state *fs) +key_bindings_dispatch(struct key_binding *bd, struct cmdq_item *item, + struct client *c, struct mouse_event *m, struct cmd_find_state *fs) { struct cmd *cmd; - struct cmdq_item *item; + struct cmdq_item *new_item; int readonly; readonly = 1; @@ -413,11 +413,14 @@ key_bindings_dispatch(struct key_binding *bd, struct client *c, readonly = 0; } if (!readonly && (c->flags & CLIENT_READONLY)) - cmdq_append(c, cmdq_get_callback(key_bindings_read_only, NULL)); + new_item = cmdq_get_callback(key_bindings_read_only, NULL); else { - item = cmdq_get_command(bd->cmdlist, fs, m, 0); + new_item = cmdq_get_command(bd->cmdlist, fs, m, 0); if (bd->flags & KEY_BINDING_REPEAT) - item->shared->flags |= CMDQ_SHARED_REPEAT; - cmdq_append(c, item); + new_item->shared->flags |= CMDQ_SHARED_REPEAT; } + if (item != NULL) + cmdq_insert_after(item, new_item); + else + cmdq_append(c, new_item); } |