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

Diff for /src/usr.bin/tmux/screen-redraw.c between version 1.27 and 1.28

version 1.27, 2014/03/31 21:34:08 version 1.28, 2014/11/14 02:19:47
Line 278 
Line 278 
         struct options          *oo = &c->session->options;          struct options          *oo = &c->session->options;
         struct tty              *tty = &c->tty;          struct tty              *tty = &c->tty;
         struct window_pane      *wp;          struct window_pane      *wp;
         struct grid_cell         active_gc, other_gc;          struct grid_cell         active_gc, other_gc, msg_gc;
         u_int                    i, j, type;          u_int                    i, j, type, msgx = 0, msgy = 0;
           int                      small, flags;
           char                     msg[256];
           const char              *tmp;
           size_t                   msglen = 0;
   
           small = (tty->sy - status + top > w->sy) || (tty->sx > w->sx);
           if (small) {
                   flags = w->flags & (WINDOW_FORCEWIDTH|WINDOW_FORCEHEIGHT);
                   if (flags == (WINDOW_FORCEWIDTH|WINDOW_FORCEHEIGHT))
                           tmp = "force-width, force-height";
                   else if (flags == WINDOW_FORCEWIDTH)
                           tmp = "force-width";
                   else if (flags == WINDOW_FORCEHEIGHT)
                           tmp = "force-height";
                   else
                           tmp = "a smaller client";
                   xsnprintf(msg, sizeof msg, "(size %ux%u from %s)",
                       w->sx, w->sy, tmp);
                   msglen = strlen(msg);
   
                   if (tty->sy - 1 - status + top > w->sy && tty->sx >= msglen) {
                           msgx = tty->sx - msglen;
                           msgy = tty->sy - 1 - status + top;
                   } else if (tty->sx - w->sx > msglen) {
                           msgx = tty->sx - msglen;
                           msgy = tty->sy - 1 - status + top;
                   } else
                           small = 0;
           }
   
         style_apply(&other_gc, oo, "pane-border-style");          style_apply(&other_gc, oo, "pane-border-style");
         style_apply(&active_gc, oo, "pane-active-border-style");          style_apply(&active_gc, oo, "pane-active-border-style");
         active_gc.attr = other_gc.attr = GRID_ATTR_CHARSET;          active_gc.attr = other_gc.attr = GRID_ATTR_CHARSET;
Line 290 
Line 319 
                         type = screen_redraw_check_cell(c, i, j, &wp);                          type = screen_redraw_check_cell(c, i, j, &wp);
                         if (type == CELL_INSIDE)                          if (type == CELL_INSIDE)
                                 continue;                                  continue;
                           if (type == CELL_OUTSIDE &&
                               small && i > msgx && j == msgy)
                                   continue;
                         if (screen_redraw_check_active(i, j, type, w, wp))                          if (screen_redraw_check_active(i, j, type, w, wp))
                                 tty_attributes(tty, &active_gc);                                  tty_attributes(tty, &active_gc);
                         else                          else
Line 297 
Line 329 
                         tty_cursor(tty, i, top + j);                          tty_cursor(tty, i, top + j);
                         tty_putc(tty, CELL_BORDERS[type]);                          tty_putc(tty, CELL_BORDERS[type]);
                 }                  }
           }
   
           if (small) {
                   memcpy(&msg_gc, &grid_default_cell, sizeof msg_gc);
                   tty_attributes(tty, &msg_gc);
                   tty_cursor(tty, msgx, msgy);
                   tty_puts(tty, msg);
         }          }
 }  }
   

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28