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

Diff for /src/usr.bin/tmux/resize.c between version 1.34 and 1.35

version 1.34, 2019/09/23 15:41:11 version 1.35, 2019/11/28 09:45:16
Line 23 
Line 23 
 #include "tmux.h"  #include "tmux.h"
   
 void  void
 resize_window(struct window *w, u_int sx, u_int sy)  resize_window(struct window *w, u_int sx, u_int sy, int xpixel, int ypixel)
 {  {
         int     zoomed;          int     zoomed;
   
Line 50 
Line 50 
                 sx = w->layout_root->sx;                  sx = w->layout_root->sx;
         if (sy < w->layout_root->sy)          if (sy < w->layout_root->sy)
                 sy = w->layout_root->sy;                  sy = w->layout_root->sy;
         window_resize(w, sx, sy);          window_resize(w, sx, sy, xpixel, ypixel);
         log_debug("%s: @%u resized to %u,%u; layout %u,%u", __func__, w->id,          log_debug("%s: @%u resized to %u,%u; layout %u,%u", __func__, w->id,
             sx, sy, w->layout_root->sx, w->layout_root->sy);              sx, sy, w->layout_root->sx, w->layout_root->sy);
   
Line 77 
Line 77 
   
 void  void
 default_window_size(struct client *c, struct session *s, struct window *w,  default_window_size(struct client *c, struct session *s, struct window *w,
     u_int *sx, u_int *sy, int type)      u_int *sx, u_int *sy, u_int *xpixel, u_int *ypixel, int type)
 {  {
         struct client   *loop;          struct client   *loop;
         u_int            cx, cy;          u_int            cx, cy;
Line 88 
Line 88 
         switch (type) {          switch (type) {
         case WINDOW_SIZE_LARGEST:          case WINDOW_SIZE_LARGEST:
                 *sx = *sy = 0;                  *sx = *sy = 0;
                   *xpixel = *ypixel = 0;
                 TAILQ_FOREACH(loop, &clients, entry) {                  TAILQ_FOREACH(loop, &clients, entry) {
                         if (ignore_client_size(loop))                          if (ignore_client_size(loop))
                                 continue;                                  continue;
Line 103 
Line 104 
                                 *sx = cx;                                  *sx = cx;
                         if (cy > *sy)                          if (cy > *sy)
                                 *sy = cy;                                  *sy = cy;
   
                           if (loop->tty.xpixel > *xpixel &&
                               loop->tty.ypixel > *ypixel) {
                                   *xpixel = loop->tty.xpixel;
                                   *ypixel = loop->tty.ypixel;
                           }
                 }                  }
                 if (*sx == 0 || *sy == 0)                  if (*sx == 0 || *sy == 0)
                         goto manual;                          goto manual;
                 break;                  break;
         case WINDOW_SIZE_SMALLEST:          case WINDOW_SIZE_SMALLEST:
                 *sx = *sy = UINT_MAX;                  *sx = *sy = UINT_MAX;
                   *xpixel = *ypixel = 0;
                 TAILQ_FOREACH(loop, &clients, entry) {                  TAILQ_FOREACH(loop, &clients, entry) {
                         if (ignore_client_size(loop))                          if (ignore_client_size(loop))
                                 continue;                                  continue;
Line 124 
Line 132 
                                 *sx = cx;                                  *sx = cx;
                         if (cy < *sy)                          if (cy < *sy)
                                 *sy = cy;                                  *sy = cy;
   
                           if (loop->tty.xpixel > *xpixel &&
                               loop->tty.ypixel > *ypixel) {
                                   *xpixel = loop->tty.xpixel;
                                   *ypixel = loop->tty.ypixel;
                           }
                 }                  }
                 if (*sx == UINT_MAX || *sy == UINT_MAX)                  if (*sx == UINT_MAX || *sy == UINT_MAX)
                         goto manual;                          goto manual;
Line 132 
Line 146 
                 if (c != NULL && !ignore_client_size(c)) {                  if (c != NULL && !ignore_client_size(c)) {
                         *sx = c->tty.sx;                          *sx = c->tty.sx;
                         *sy = c->tty.sy - status_line_size(c);                          *sy = c->tty.sy - status_line_size(c);
                           *xpixel = c->tty.xpixel;
                           *ypixel = c->tty.ypixel;
                 } else {                  } else {
                         *sx = *sy = UINT_MAX;                          *sx = *sy = UINT_MAX;
                           *xpixel = *ypixel = 0;
                         TAILQ_FOREACH(loop, &clients, entry) {                          TAILQ_FOREACH(loop, &clients, entry) {
                                 if (ignore_client_size(loop))                                  if (ignore_client_size(loop))
                                         continue;                                          continue;
Line 148 
Line 165 
                                         *sx = cx;                                          *sx = cx;
                                 if (cy < *sy)                                  if (cy < *sy)
                                         *sy = cy;                                          *sy = cy;
   
                                   if (loop->tty.xpixel > *xpixel &&
                                       loop->tty.ypixel > *ypixel) {
                                           *xpixel = loop->tty.xpixel;
                                           *ypixel = loop->tty.ypixel;
                                   }
                         }                          }
                         if (*sx == UINT_MAX || *sy == UINT_MAX)                          if (*sx == UINT_MAX || *sy == UINT_MAX)
                                 goto manual;                                  goto manual;
Line 181 
Line 204 
 {  {
         struct session  *s;          struct session  *s;
         struct client   *c;          struct client   *c;
         u_int            sx, sy, cx, cy;          u_int            sx, sy, cx, cy, xpixel = 0, ypixel = 0;
         int              type, current, has, changed;          int              type, current, has, changed;
   
         if (w->active == NULL)          if (w->active == NULL)
Line 214 
Line 237 
                                 sx = cx;                                  sx = cx;
                         if (cy > sy)                          if (cy > sy)
                                 sy = cy;                                  sy = cy;
   
                           if (c->tty.xpixel > xpixel && c->tty.ypixel > ypixel) {
                                   xpixel = c->tty.xpixel;
                                   ypixel = c->tty.ypixel;
                           }
                 }                  }
                 if (sx == 0 || sy == 0)                  if (sx == 0 || sy == 0)
                         changed = 0;                          changed = 0;
Line 239 
Line 267 
                                 sx = cx;                                  sx = cx;
                         if (cy < sy)                          if (cy < sy)
                                 sy = cy;                                  sy = cy;
   
                           if (c->tty.xpixel > xpixel && c->tty.ypixel > ypixel) {
                                   xpixel = c->tty.xpixel;
                                   ypixel = c->tty.ypixel;
                           }
                 }                  }
                 if (sx == UINT_MAX || sy == UINT_MAX)                  if (sx == UINT_MAX || sy == UINT_MAX)
                         changed = 0;                          changed = 0;
Line 266 
Line 299 
                                 sx = cx;                                  sx = cx;
                         if (cy < sy)                          if (cy < sy)
                                 sy = cy;                                  sy = cy;
   
                           if (c->tty.xpixel > xpixel && c->tty.ypixel > ypixel) {
                                   xpixel = c->tty.xpixel;
                                   ypixel = c->tty.ypixel;
                           }
                 }                  }
                 if (sx == UINT_MAX || sy == UINT_MAX)                  if (sx == UINT_MAX || sy == UINT_MAX)
                         changed = 0;                          changed = 0;
Line 281 
Line 319 
                 tty_update_window_offset(w);                  tty_update_window_offset(w);
                 return;                  return;
         }          }
         log_debug("%s: @%u changed to %u,%u", __func__, w->id, sx, sy);          log_debug("%s: @%u changed to %u,%u (%ux%u)", __func__, w->id, sx, sy,
         resize_window(w, sx, sy);              xpixel, ypixel);
           resize_window(w, sx, sy, xpixel, ypixel);
 }  }
   
 void  void

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35