diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-06 17:20:30 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-06 17:20:30 +0000 |
commit | 6a187bb8d379b6f3b77adcd3550ab31dc8058030 (patch) | |
tree | 1e5f6db8f36ac16e857fd9298f314dcf262e44b3 /server.c | |
parent | ac332b6e79b9518f1f0e7c9e563f93ce696c252b (diff) | |
download | rtmux-6a187bb8d379b6f3b77adcd3550ab31dc8058030.tar.gz rtmux-6a187bb8d379b6f3b77adcd3550ab31dc8058030.tar.bz2 rtmux-6a187bb8d379b6f3b77adcd3550ab31dc8058030.zip |
Some Linux fixes; some code tidying. Don't redraw status bar so often.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.53 2008-06-04 17:54:26 nicm Exp $ */ +/* $Id: server.c,v 1.54 2008-06-06 17:20:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -32,6 +32,7 @@ #include <string.h> #include <syslog.h> #include <termios.h> +#include <time.h> #include <unistd.h> #include "tmux.h" @@ -415,19 +416,21 @@ server_handle_window(struct window *w) { struct session *s; u_int i; - int action; + int action, update; window_parse(w); if (!(w->flags & WINDOW_BELL) && !(w->flags & WINDOW_ACTIVITY)) return; + update = 0; for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { s = ARRAY_ITEM(&sessions, i); if (s == NULL || !session_has(s, w)) continue; - if (w->flags & WINDOW_BELL) { + if (w->flags & WINDOW_BELL && + !session_alert_has(s, w, WINDOW_BELL)) { session_alert_add(s, w, WINDOW_BELL); action = options_get_number(&s->options, "bell-action"); @@ -441,12 +444,18 @@ server_handle_window(struct window *w) tty_write_session(s, TTY_CHARACTER, '\007'); break; } + update = 1; } - if ((w->flags & WINDOW_MONITOR) && (w->flags & WINDOW_ACTIVITY)) + if ((w->flags & WINDOW_MONITOR) && + (w->flags & WINDOW_ACTIVITY) && + !session_alert_has(s, w, WINDOW_ACTIVITY)) { session_alert_add(s, w, WINDOW_ACTIVITY); + update = 1; + } } - server_status_window(w); + if (update) + server_status_window(w); w->flags &= ~(WINDOW_BELL|WINDOW_ACTIVITY); } |