[BACK]Return to alerts.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/alerts.c between version 1.7 and 1.8

version 1.7, 2015/11/20 16:33:46 version 1.8, 2015/12/07 09:47:41
Line 29 
Line 29 
 void    alerts_callback(int, short, void *);  void    alerts_callback(int, short, void *);
 void    alerts_reset(struct window *);  void    alerts_reset(struct window *);
   
   int     alerts_check_all(struct session *, struct winlink *);
 int     alerts_check_bell(struct session *, struct winlink *);  int     alerts_check_bell(struct session *, struct winlink *);
 int     alerts_check_activity(struct session *, struct winlink *);  int     alerts_check_activity(struct session *, struct winlink *);
 int     alerts_check_silence(struct session *, struct winlink *);  int     alerts_check_silence(struct session *, struct winlink *);
Line 54 
Line 55 
   
         RB_FOREACH(w, windows, &windows) {          RB_FOREACH(w, windows, &windows) {
                 RB_FOREACH(s, sessions, &sessions) {                  RB_FOREACH(s, sessions, &sessions) {
                           if (s->flags & SESSION_UNATTACHED)
                                   continue;
                         RB_FOREACH(wl, winlinks, &s->windows) {                          RB_FOREACH(wl, winlinks, &s->windows) {
                                 if (wl->window != w)                                  if (wl->window != w)
                                         continue;                                          continue;
                                 flags = w->flags;                                  flags = w->flags;
   
                                 alerts  = alerts_check_bell(s, wl);                                  alerts = alerts_check_all(s, wl);
                                 alerts |= alerts_check_activity(s, wl);  
                                 alerts |= alerts_check_silence(s, wl);  
                                 if (alerts != 0)  
                                         server_status_session(s);  
   
                                 log_debug("%s:%d @%u alerts check, alerts %#x, "                                  log_debug("%s:%d @%u alerts check, alerts %#x, "
                                     "flags %#x", s->name, wl->idx, w->id,                                      "flags %#x", s->name, wl->idx, w->id,
Line 75 
Line 74 
 }  }
   
 int  int
   alerts_check_all(struct session *s, struct winlink *wl)
   {
           int     alerts;
   
           alerts  = alerts_check_bell(s, wl);
           alerts |= alerts_check_activity(s, wl);
           alerts |= alerts_check_silence(s, wl);
           if (alerts != 0)
                   server_status_session(s);
   
           return (alerts);
   }
   
   void
   alerts_check_session(struct session *s)
   {
           struct winlink  *wl;
   
           RB_FOREACH(wl, winlinks, &s->windows)
                   alerts_check_all(s, wl);
   }
   
   int
 alerts_enabled(struct window *w, int flags)  alerts_enabled(struct window *w, int flags)
 {  {
         if (flags & WINDOW_BELL)          if (flags & WINDOW_BELL)
Line 143 
Line 165 
         struct window   *w = wl->window;          struct window   *w = wl->window;
         int              action, visual;          int              action, visual;
   
         if (!(w->flags & WINDOW_BELL) || wl->flags & WINLINK_BELL)          if (!(w->flags & WINDOW_BELL))
                 return (0);                  return (0);
         if (s->curw != wl || s->flags & SESSION_UNATTACHED)          if (s->curw != wl) {
                 wl->flags |= WINLINK_BELL;                  wl->flags |= WINLINK_BELL;
         if (s->flags & SESSION_UNATTACHED)                  w->flags &= ~WINDOW_BELL;
                 return (0);          }
         if (s->curw->window == w)          if (s->curw->window == w)
                 w->flags &= ~WINDOW_BELL;                  w->flags &= ~WINDOW_BELL;
   
Line 190 
Line 212 
   
         if (!(w->flags & WINDOW_ACTIVITY) || wl->flags & WINLINK_ACTIVITY)          if (!(w->flags & WINDOW_ACTIVITY) || wl->flags & WINLINK_ACTIVITY)
                 return (0);                  return (0);
         if (s->curw == wl && !(s->flags & SESSION_UNATTACHED))          if (s->curw == wl)
                 return (0);                  return (0);
   
         if (!options_get_number(w->options, "monitor-activity"))          if (!options_get_number(w->options, "monitor-activity"))
Line 222 
Line 244 
   
         if (!(w->flags & WINDOW_SILENCE) || wl->flags & WINLINK_SILENCE)          if (!(w->flags & WINDOW_SILENCE) || wl->flags & WINLINK_SILENCE)
                 return (0);                  return (0);
         if (s->curw == wl && !(s->flags & SESSION_UNATTACHED))          if (s->curw == wl)
                 return (0);                  return (0);
   
         if (options_get_number(w->options, "monitor-silence") == 0)          if (options_get_number(w->options, "monitor-silence") == 0)

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8