summaryrefslogtreecommitdiffstats
path: root/cmd-set-window-option.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-04 18:32:20 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-04 18:32:20 +0000
commitf34b6190496ba8e6f1af82540eb6e6f1b34a7424 (patch)
treed98cdccc664bc4546a1607a63bb096953ce53f32 /cmd-set-window-option.c
parentb25ac6fd754a38081d09ec32e5dbed717e628492 (diff)
Make monitor-activity w/o arguments toggle.
Diffstat (limited to 'cmd-set-window-option.c')
-rw-r--r--cmd-set-window-option.c16
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);