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

Diff for /src/usr.bin/tmux/window.c between version 1.212 and 1.213

version 1.212, 2018/08/05 08:59:30 version 1.213, 2018/10/18 08:38:01
Line 380 
Line 380 
   
         if (event_initialized(&w->alerts_timer))          if (event_initialized(&w->alerts_timer))
                 evtimer_del(&w->alerts_timer);                  evtimer_del(&w->alerts_timer);
           if (event_initialized(&w->offset_timer))
                   event_del(&w->offset_timer);
   
         options_free(w->options);          options_free(w->options);
   
Line 458 
Line 460 
                 return (0);                  return (0);
         w->last = w->active;          w->last = w->active;
         w->active = wp;          w->active = wp;
         while (!window_pane_visible(w->active)) {  
                 w->active = TAILQ_PREV(w->active, window_panes, entry);  
                 if (w->active == NULL)  
                         w->active = TAILQ_LAST(&w->panes, window_panes);  
                 if (w->active == wp) {  
                         notify_window("window-pane-changed", w);  
                         return (1);  
                 }  
         }  
         w->active->active_point = next_active_point++;          w->active->active_point = next_active_point++;
         w->active->flags |= PANE_CHANGED;          w->active->flags |= PANE_CHANGED;
           tty_update_window_offset(w);
         notify_window("window-pane-changed", w);          notify_window("window-pane-changed", w);
         return (1);          return (1);
 }  }
Line 509 
Line 503 
         struct window_pane      *wp;          struct window_pane      *wp;
   
         TAILQ_FOREACH(wp, &w->panes, entry) {          TAILQ_FOREACH(wp, &w->panes, entry) {
                 if (!window_pane_visible(wp))                  if (!window_pane_visible(wp))
                         continue;                          continue;
                 if (x < wp->xoff || x > wp->xoff + wp->sx)                  if (x < wp->xoff || x > wp->xoff + wp->sx)
                         continue;                          continue;
                 if (y < wp->yoff || y > wp->yoff + wp->sy)                  if (y < wp->yoff || y > wp->yoff + wp->sy)
Line 563 
Line 557 
         if (w->flags & WINDOW_ZOOMED)          if (w->flags & WINDOW_ZOOMED)
                 return (-1);                  return (-1);
   
         if (!window_pane_visible(wp))  
                 return (-1);  
   
         if (window_count_panes(w) == 1)          if (window_count_panes(w) == 1)
                 return (-1);                  return (-1);
   
Line 602 
Line 593 
                 wp->layout_cell = wp->saved_layout_cell;                  wp->layout_cell = wp->saved_layout_cell;
                 wp->saved_layout_cell = NULL;                  wp->saved_layout_cell = NULL;
         }          }
         layout_fix_panes(w, w->sx, w->sy);          layout_fix_panes(w);
         notify_window("window-layout-changed", w);          notify_window("window-layout-changed", w);
   
         return (0);          return (0);
Line 1284 
Line 1275 
                 return;                  return;
         if (options_get_number(wp->window->options, "synchronize-panes")) {          if (options_get_number(wp->window->options, "synchronize-panes")) {
                 TAILQ_FOREACH(wp2, &wp->window->panes, entry) {                  TAILQ_FOREACH(wp2, &wp->window->panes, entry) {
                         if (wp2 == wp || wp2->mode != NULL)                          if (wp2 != wp &&
                                 continue;                              wp2->mode == NULL &&
                         if (wp2->fd == -1 || wp2->flags & PANE_INPUTOFF)                              wp2->fd != -1 &&
                                 continue;                              (~wp2->flags & PANE_INPUTOFF) &&
                         if (window_pane_visible(wp2))                              window_pane_visible(wp2))
                                 input_key(wp2, key, NULL);                                  input_key(wp2, key, NULL);
                 }                  }
         }          }
Line 1297 
Line 1288 
 int  int
 window_pane_visible(struct window_pane *wp)  window_pane_visible(struct window_pane *wp)
 {  {
         struct window   *w = wp->window;          if (~wp->window->flags & WINDOW_ZOOMED)
                   return (1);
         if (wp->layout_cell == NULL)          return (wp == wp->window->active);
                 return (0);  
   
         if (wp->xoff >= w->sx || wp->yoff >= w->sy)  
                 return (0);  
         if (wp->xoff + wp->sx > w->sx || wp->yoff + wp->sy > w->sy)  
                 return (0);  
         return (1);  
 }  }
   
 u_int  u_int
Line 1363 
Line 1347 
         u_int                    edge, left, right, end, size;          u_int                    edge, left, right, end, size;
         int                      status, found;          int                      status, found;
   
         if (wp == NULL || !window_pane_visible(wp))          if (wp == NULL)
                 return (NULL);                  return (NULL);
         status = options_get_number(wp->window->options, "pane-border-status");          status = options_get_number(wp->window->options, "pane-border-status");
   
Line 1378 
Line 1362 
         right = wp->xoff + wp->sx;          right = wp->xoff + wp->sx;
   
         TAILQ_FOREACH(next, &wp->window->panes, entry) {          TAILQ_FOREACH(next, &wp->window->panes, entry) {
                 if (next == wp || !window_pane_visible(next))                  if (next == wp)
                         continue;                          continue;
                 if (next->yoff + next->sy + 1 != edge)                  if (next->yoff + next->sy + 1 != edge)
                         continue;                          continue;
Line 1410 
Line 1394 
         u_int                    edge, left, right, end, size;          u_int                    edge, left, right, end, size;
         int                      status, found;          int                      status, found;
   
         if (wp == NULL || !window_pane_visible(wp))          if (wp == NULL)
                 return (NULL);                  return (NULL);
         status = options_get_number(wp->window->options, "pane-border-status");          status = options_get_number(wp->window->options, "pane-border-status");
   
Line 1425 
Line 1409 
         right = wp->xoff + wp->sx;          right = wp->xoff + wp->sx;
   
         TAILQ_FOREACH(next, &wp->window->panes, entry) {          TAILQ_FOREACH(next, &wp->window->panes, entry) {
                 if (next == wp || !window_pane_visible(next))                  if (next == wp)
                         continue;                          continue;
                 if (next->yoff != edge)                  if (next->yoff != edge)
                         continue;                          continue;
Line 1457 
Line 1441 
         u_int                    edge, top, bottom, end, size;          u_int                    edge, top, bottom, end, size;
         int                      found;          int                      found;
   
         if (wp == NULL || !window_pane_visible(wp))          if (wp == NULL)
                 return (NULL);                  return (NULL);
   
         list = NULL;          list = NULL;
Line 1471 
Line 1455 
         bottom = wp->yoff + wp->sy;          bottom = wp->yoff + wp->sy;
   
         TAILQ_FOREACH(next, &wp->window->panes, entry) {          TAILQ_FOREACH(next, &wp->window->panes, entry) {
                 if (next == wp || !window_pane_visible(next))                  if (next == wp)
                         continue;                          continue;
                 if (next->xoff + next->sx + 1 != edge)                  if (next->xoff + next->sx + 1 != edge)
                         continue;                          continue;
Line 1503 
Line 1487 
         u_int                    edge, top, bottom, end, size;          u_int                    edge, top, bottom, end, size;
         int                      found;          int                      found;
   
         if (wp == NULL || !window_pane_visible(wp))          if (wp == NULL)
                 return (NULL);                  return (NULL);
   
         list = NULL;          list = NULL;
Line 1517 
Line 1501 
         bottom = wp->yoff + wp->sy;          bottom = wp->yoff + wp->sy;
   
         TAILQ_FOREACH(next, &wp->window->panes, entry) {          TAILQ_FOREACH(next, &wp->window->panes, entry) {
                 if (next == wp || !window_pane_visible(next))                  if (next == wp)
                         continue;                          continue;
                 if (next->xoff != edge)                  if (next->xoff != edge)
                         continue;                          continue;

Legend:
Removed from v.1.212  
changed lines
  Added in v.1.213