diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-04 18:32:20 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-04 18:32:20 +0000 |
commit | f34b6190496ba8e6f1af82540eb6e6f1b34a7424 (patch) | |
tree | d98cdccc664bc4546a1607a63bb096953ce53f32 /cmd-set-window-option.c | |
parent | b25ac6fd754a38081d09ec32e5dbed717e628492 (diff) |
Make monitor-activity w/o arguments toggle.
Diffstat (limited to 'cmd-set-window-option.c')
-rw-r--r-- | cmd-set-window-option.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cmd-set-window-option.c b/cmd-set-window-option.c index 8504a446..af8d777b 100644 --- a/cmd-set-window-option.c +++ b/cmd-set-window-option.c @@ -1,4 +1,4 @@ -/* $Id: cmd-set-window-option.c,v 1.1 2008-06-04 17:54:26 nicm Exp $ */ +/* $Id: cmd-set-window-option.c,v 1.2 2008-06-04 18:32:20 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -151,7 +151,7 @@ cmd_set_window_option_exec(void *ptr, unused struct cmd_ctx *ctx) strcasecmp(data->value, "no") == 0) bool = 0; } else - bool = 1; + bool = -2; if (strcmp(data->option, "monitor-activity") == 0) { if (bool == -1) { @@ -159,10 +159,14 @@ cmd_set_window_option_exec(void *ptr, unused struct cmd_ctx *ctx) return; } - if (bool) - wl->window->flags |= WINDOW_MONITOR; - else - wl->window->flags &= ~WINDOW_MONITOR; + if (bool == -2) + wl->window->flags ^= WINDOW_MONITOR; + else { + if (bool) + wl->window->flags |= WINDOW_MONITOR; + else + wl->window->flags &= ~WINDOW_MONITOR; + } for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { s = ARRAY_ITEM(&sessions, i); |