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

Diff for /src/usr.bin/tmux/Attic/server-window.c between version 1.2 and 1.3

version 1.2, 2009/10/27 13:03:33 version 1.3, 2009/10/28 22:53:14
Line 22 
Line 22 
   
 #include "tmux.h"  #include "tmux.h"
   
   int     server_window_backoff(struct window_pane *);
 int     server_window_check_bell(struct session *, struct window *);  int     server_window_check_bell(struct session *, struct window *);
 int     server_window_check_activity(struct session *, struct window *);  int     server_window_check_activity(struct session *, struct window *);
 int     server_window_check_content(  int     server_window_check_content(
Line 44 
Line 45 
                 TAILQ_FOREACH(wp, &w->panes, entry) {                  TAILQ_FOREACH(wp, &w->panes, entry) {
                         if (wp->fd == -1)                          if (wp->fd == -1)
                                 continue;                                  continue;
                         events = POLLIN;                          events = 0;
                           if (!server_window_backoff(wp))
                                   events |= POLLIN;
                         if (BUFFER_USED(wp->out) > 0)                          if (BUFFER_USED(wp->out) > 0)
                                 events |= POLLOUT;                                  events |= POLLOUT;
                         server_poll_add(                          server_poll_add(
Line 59 
Line 62 
                             wp->pipe_fd, events, server_window_callback, wp);                              wp->pipe_fd, events, server_window_callback, wp);
                 }                  }
         }          }
   }
   
   /* Check if this window should suspend reading. */
   int
   server_window_backoff(struct window_pane *wp)
   {
           struct client   *c;
           u_int            i;
   
           if (!window_pane_visible(wp))
                   return (0);
   
           for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
                   c = ARRAY_ITEM(&clients, i);
                   if (c == NULL || c->session == NULL)
                           continue;
                   if (c->session->curw->window != wp->window)
                           continue;
                   if (BUFFER_USED(c->tty.out) > BACKOFF_THRESHOLD)
                           return (1);
           }
           return (0);
 }  }
   
 /* Process a single window pane event. */  /* Process a single window pane event. */

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3