diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-05 15:42:20 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-05 15:42:20 +0100 |
commit | 2f89d2e7d816918e152aacfee85fab45ee2057b9 (patch) | |
tree | 98f86226f36a6bf5e1a88bef8ca1d6cdb02612b8 /cmd-switch-client.c | |
parent | deacfedc65e6de6b3f84348d6723ae6f14d097df (diff) | |
download | rtmux-2f89d2e7d816918e152aacfee85fab45ee2057b9.tar.gz rtmux-2f89d2e7d816918e152aacfee85fab45ee2057b9.tar.bz2 rtmux-2f89d2e7d816918e152aacfee85fab45ee2057b9.zip |
Change the existing client flags for control mode to apply for any client, use
the same mechanism for the read-only flag and add an ignore-size flag.
refresh-client -F has become -f (-F stays for backwards compatibility) and
attach-session and switch-client now have -f flags also. A new format
"client_flags" lists the flags and is shown by list-clients by default.
This separates the read-only flag from "ignore size" behaviour (new
ignore-size) flag - both behaviours are useful in different circumstances.
attach -r and switchc -r remain and set or toggle both flags together.
Diffstat (limited to 'cmd-switch-client.c')
-rw-r--r-- | cmd-switch-client.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd-switch-client.c b/cmd-switch-client.c index 82510ce6..d062b946 100644 --- a/cmd-switch-client.c +++ b/cmd-switch-client.c @@ -34,7 +34,7 @@ const struct cmd_entry cmd_switch_client_entry = { .name = "switch-client", .alias = "switchc", - .args = { "lc:Enpt:rT:Z", 0, 0 }, + .args = { "lc:EFnpt:rT:Z", 0, 0 }, .usage = "[-ElnprZ] [-c target-client] [-t target-session] " "[-T key-table]", @@ -74,8 +74,12 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item) wl = target.wl; wp = target.wp; - if (args_has(args, 'r')) - tc->flags ^= CLIENT_READONLY; + if (args_has(args, 'r')) { + if (tc->flags & CLIENT_READONLY) + tc->flags &= ~(CLIENT_READONLY|CLIENT_IGNORESIZE); + else + tc->flags |= (CLIENT_READONLY|CLIENT_IGNORESIZE); + } tablename = args_get(args, 'T'); if (tablename != NULL) { |