diff options
-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); |