From e2100c5f5f9c71185e2a3c410ebdd37f52d701a7 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 28 Aug 2015 15:51:48 +0000 Subject: We now only checking for name changes when the active pane has changed, but that can only happen when we have already been woken up by a read event, so there is no need for a timer, we can just check the changed flag on the end of that read event (we already loop over the windows to check for bells etc anyway). --- cmd-set-option.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cmd-set-option.c') diff --git a/cmd-set-option.c b/cmd-set-option.c index 56ca91e0..631a4d0e 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -180,9 +180,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq) if (strcmp(oe->name, "automatic-rename") == 0) { RB_FOREACH(w, windows, &windows) { if (options_get_number(&w->options, "automatic-rename")) - queue_window_name(w); - else if (event_initialized(&w->name_timer)) - evtimer_del(&w->name_timer); + w->active->flags |= PANE_CHANGED; } } if (strcmp(oe->name, "status") == 0 || -- cgit From 55b8d7456155de4e5d44136a140a599e2a2a755b Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 28 Aug 2015 16:10:46 +0000 Subject: Revert previous; we do need a timer, until I have a better idea. We can't do the name check every loop, because that is too expensive, and we can't make sure it only happens infrequently because we have no idea when the next change will happen. --- cmd-set-option.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd-set-option.c') diff --git a/cmd-set-option.c b/cmd-set-option.c index 631a4d0e..56ca91e0 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -180,7 +180,9 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq) if (strcmp(oe->name, "automatic-rename") == 0) { RB_FOREACH(w, windows, &windows) { if (options_get_number(&w->options, "automatic-rename")) - w->active->flags |= PANE_CHANGED; + queue_window_name(w); + else if (event_initialized(&w->name_timer)) + evtimer_del(&w->name_timer); } } if (strcmp(oe->name, "status") == 0 || -- cgit From b7861f34bae7a9e00446e0a8cf2f38e220c41c79 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 29 Aug 2015 00:29:15 +0000 Subject: Better take on reducing the name timer. Again check for name changes in the main loop after events that may have changed the pane, but do so at most once every 500 millis. If the pane changed too soon, use a timer to ensure that a check happens later. --- cmd-set-option.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cmd-set-option.c') diff --git a/cmd-set-option.c b/cmd-set-option.c index 56ca91e0..631a4d0e 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -180,9 +180,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq) if (strcmp(oe->name, "automatic-rename") == 0) { RB_FOREACH(w, windows, &windows) { if (options_get_number(&w->options, "automatic-rename")) - queue_window_name(w); - else if (event_initialized(&w->name_timer)) - evtimer_del(&w->name_timer); + w->active->flags |= PANE_CHANGED; } } if (strcmp(oe->name, "status") == 0 || -- cgit From b5aaefc727f303276a681d74f091f52a7e859d36 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 29 Aug 2015 08:30:54 +0000 Subject: Move alerts onto events rather than checking every loop. --- cmd-set-option.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd-set-option.c') diff --git a/cmd-set-option.c b/cmd-set-option.c index 631a4d0e..98ab2513 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -186,6 +186,8 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq) if (strcmp(oe->name, "status") == 0 || strcmp(oe->name, "status-interval") == 0) status_timer_start_all(); + if (strcmp(oe->name, "monitor-silence") == 0) + alerts_reset_all(); /* Update sizes and redraw. May not need it but meh. */ recalculate_sizes(); -- cgit