aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/window.c b/window.c
index c172b68e..d8506774 100644
--- a/window.c
+++ b/window.c
@@ -277,6 +277,13 @@ window_find_by_id(u_int id)
return (RB_FIND(windows, &windows, &w));
}
+void
+window_update_activity(struct window *w)
+{
+ gettimeofday(&w->activity_time, NULL);
+ alerts_queue(w, WINDOW_ACTIVITY);
+}
+
struct window *
window_create1(u_int sx, u_int sy)
{
@@ -295,9 +302,6 @@ window_create1(u_int sx, u_int sy)
w->sx = sx;
w->sy = sy;
- if (gettimeofday(&w->activity_time, NULL) != 0)
- fatal("gettimeofday failed");
-
options_init(&w->options, &global_w_options);
w->references = 0;
@@ -305,6 +309,8 @@ window_create1(u_int sx, u_int sy)
w->id = next_window_id++;
RB_INSERT(windows, &windows, w);
+ window_update_activity(w);
+
return (w);
}
@@ -350,6 +356,9 @@ window_destroy(struct window *w)
if (event_initialized(&w->name_event))
evtimer_del(&w->name_event);
+ if (event_initialized(&w->alerts_timer))
+ evtimer_del(&w->alerts_timer);
+
options_free(&w->options);
window_destroy_panes(w);
@@ -929,14 +938,6 @@ window_pane_read_callback(unused struct bufferevent *bufev, void *data)
input_parse(wp);
wp->pipe_off = EVBUFFER_LENGTH(evb);
-
- /*
- * If we get here, we're not outputting anymore, so set the silence
- * flag on the window.
- */
- wp->window->flags |= WINDOW_SILENCE;
- if (gettimeofday(&wp->window->silence_timer, NULL) != 0)
- fatal("gettimeofday failed");
return;
start_timer: