diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-04-08 06:47:26 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-04-08 06:47:26 +0000 |
commit | 631d6b59fdb193cc29d845d1baf30b729a4cb75a (patch) | |
tree | 90e2f029008bc8cba2e6a5140d799d2e1ed712c1 /cmd-set-option.c | |
parent | ed54f01d2f830935e443b3c009a6ef6085c9ae20 (diff) | |
download | rtmux-631d6b59fdb193cc29d845d1baf30b729a4cb75a.tar.gz rtmux-631d6b59fdb193cc29d845d1baf30b729a4cb75a.tar.bz2 rtmux-631d6b59fdb193cc29d845d1baf30b729a4cb75a.zip |
Do not fire name timer when automatic-rename is off, from Tim Ruehsen a
while ago.
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r-- | cmd-set-option.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c index 153d2d88..ff138873 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -87,6 +87,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx) struct winlink *wl; struct client *c; struct options *oo; + struct window *w; const char *optstr, *valstr; u_int i; @@ -147,6 +148,18 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx) return (-1); } + /* Start or stop timers when automatic-rename changed. */ + if (strcmp (oe->name, "automatic-rename") == 0) { + for (i = 0; i < ARRAY_LENGTH(&windows); i++) { + if ((w = ARRAY_ITEM(&windows, i)) == NULL) + continue; + if (options_get_number(&w->options, "automatic-rename")) + queue_window_name(w); + else if (event_initialized(&w->name_timer)) + evtimer_del(&w->name_timer); + } + } + /* Update sizes and redraw. May not need it but meh. */ recalculate_sizes(); for (i = 0; i < ARRAY_LENGTH(&clients); i++) { |