diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-06 17:55:27 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-06 17:55:27 +0000 |
commit | 3cd4a08ffb4bcba0cfbb8a29574ff40d134dc186 (patch) | |
tree | 321523836e1c269edaab4a07caa1a41546501a84 /session.c | |
parent | 6a187bb8d379b6f3b77adcd3550ab31dc8058030 (diff) | |
download | rtmux-3cd4a08ffb4bcba0cfbb8a29574ff40d134dc186.tar.gz rtmux-3cd4a08ffb4bcba0cfbb8a29574ff40d134dc186.tar.bz2 rtmux-3cd4a08ffb4bcba0cfbb8a29574ff40d134dc186.zip |
Make server exit when last session dies. Also fix window check for status activity redraw.
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: session.c,v 1.35 2008-06-06 17:20:29 nicm Exp $ */ +/* $Id: session.c,v 1.36 2008-06-06 17:55:27 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -55,7 +55,8 @@ session_alert_add(struct session *s, struct window *w, int type) if (wl == s->curw) continue; - if (wl->window == w && !session_alert_has(s, wl, type)) { + if (wl->window == w && + !session_alert_has(s, wl, type)) { sa = xmalloc(sizeof *sa); sa->wl = wl; sa->type = type; @@ -77,6 +78,19 @@ session_alert_has(struct session *s, struct winlink *wl, int type) return (0); } +int +session_alert_has_window(struct session *s, struct window *w, int type) +{ + struct session_alert *sa; + + TAILQ_FOREACH(sa, &s->alerts, entry) { + if (sa->wl->window == w && sa->type == type) + return (1); + } + + return (0); +} + /* Find session by name. */ struct session * session_find(const char *name) |