diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-01-21 19:36:40 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-01-21 19:36:40 +0000 |
commit | a7b0b30bdd73f3a8d513fc69daf593174ee03145 (patch) | |
tree | dc44cb8d870c4786d9349be8ce123098d022d9f2 /server-client.c | |
parent | d4c2a935f2039e00a7a7384fa0427a6126111611 (diff) | |
download | rtmux-a7b0b30bdd73f3a8d513fc69daf593174ee03145.tar.gz rtmux-a7b0b30bdd73f3a8d513fc69daf593174ee03145.tar.bz2 rtmux-a7b0b30bdd73f3a8d513fc69daf593174ee03145.zip |
Sync OpenBSD patchset 1007:
Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.
Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.
People who want three prefix keys are out of luck :-).
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/server-client.c b/server-client.c index 40655748..3ba4ed1f 100644 --- a/server-client.c +++ b/server-client.c @@ -272,9 +272,7 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data) struct options *oo; struct timeval tv; struct key_binding *bd; - struct keylist *keylist; int xtimeout, isprefix; - u_int i; /* Check the client is good to accept input. */ if ((c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0) @@ -359,14 +357,12 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data) } /* Is this a prefix key? */ - keylist = options_get_data(&c->session->options, "prefix"); - isprefix = 0; - for (i = 0; i < ARRAY_LENGTH(keylist); i++) { - if (key == ARRAY_ITEM(keylist, i)) { - isprefix = 1; - break; - } - } + if (key == options_get_number(&c->session->options, "prefix")) + isprefix = 1; + else if (key == options_get_number(&c->session->options, "prefix2")) + isprefix = 1; + else + isprefix = 0; /* No previous prefix key. */ if (!(c->flags & CLIENT_PREFIX)) { |