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

Diff for /src/usr.bin/tmux/server-fn.c between version 1.24 and 1.25

version 1.24, 2009/10/04 10:55:30 version 1.25, 2009/10/10 10:02:48
Line 105 
Line 105 
 }  }
   
 void  void
   server_redraw_session_group(struct session *s)
   {
           struct session_group    *sg;
   
           if ((sg = session_group_find(s)) == NULL)
                   server_redraw_session(s);
           else {
                   TAILQ_FOREACH(s, &sg->sessions, gentry)
                           server_redraw_session(s);
           }
   }
   
   void
 server_status_session(struct session *s)  server_status_session(struct session *s)
 {  {
         struct client   *c;          struct client   *c;
Line 120 
Line 133 
 }  }
   
 void  void
   server_status_session_group(struct session *s)
   {
           struct session_group    *sg;
   
           if ((sg = session_group_find(s)) == NULL)
                   server_status_session(s);
           else {
                   TAILQ_FOREACH(s, &sg->sessions, gentry)
                           server_status_session(s);
           }
   }
   
   void
 server_redraw_window(struct window *w)  server_redraw_window(struct window *w)
 {  {
         struct client   *c;          struct client   *c;
Line 220 
Line 246 
                         continue;                          continue;
   
                 if (session_detach(s, wl))                  if (session_detach(s, wl))
                         server_destroy_session(s);                          server_destroy_session_group(s);
                 else                  else {
                         server_redraw_session(s);                          server_redraw_session(s);
                           server_status_session_group(s);
                   }
         }          }
 }  }
   
 int  int
 server_link_window(  server_link_window(struct session *src, struct winlink *srcwl,
     struct winlink *srcwl, struct session *dst, int dstidx,      struct session *dst, int dstidx, int killflag, int selectflag, char **cause)
     int killflag, int selectflag, char **cause)  
 {  {
         struct winlink  *dstwl;          struct winlink          *dstwl;
           struct session_group    *srcsg, *dstsg;
   
           srcsg = session_group_find(src);
           dstsg = session_group_find(dst);
           if (src != dst && srcsg != NULL && dstsg != NULL && srcsg == dstsg) {
                   xasprintf(cause, "sessions are grouped");
                   return (-1);
           }
   
         dstwl = NULL;          dstwl = NULL;
         if (dstidx != -1)          if (dstidx != -1)
                 dstwl = winlink_find_by_index(&dst->windows, dstidx);                  dstwl = winlink_find_by_index(&dst->windows, dstidx);
Line 260 
Line 295 
         if (dstwl == NULL)          if (dstwl == NULL)
                 return (-1);                  return (-1);
   
         if (!selectflag)          if (selectflag)
                 server_status_session(dst);  
         else {  
                 session_select(dst, dstwl->idx);                  session_select(dst, dstwl->idx);
                 server_redraw_session(dst);          server_redraw_session_group(dst);
         }  
   
         return (0);          return (0);
 }  }
Line 274 
Line 306 
 server_unlink_window(struct session *s, struct winlink *wl)  server_unlink_window(struct session *s, struct winlink *wl)
 {  {
         if (session_detach(s, wl))          if (session_detach(s, wl))
                 server_destroy_session(s);                  server_destroy_session_group(s);
         else          else
                 server_redraw_session(s);                  server_redraw_session_group(s);
   }
   
   void
   server_destroy_session_group(struct session *s)
   {
           struct session_group    *sg;
   
           if ((sg = session_group_find(s)) == NULL)
                   server_destroy_session(s);
           else {
                   TAILQ_FOREACH(s, &sg->sessions, gentry)
                           server_destroy_session(s);
                   TAILQ_REMOVE(&session_groups, sg, entry);
                   xfree(sg);
           }
 }  }
   
 void  void

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25