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

Diff for /src/usr.bin/tmux/window-copy.c between version 1.59 and 1.60

version 1.59, 2010/06/06 19:00:13 version 1.60, 2010/06/29 05:24:49
Line 762 
Line 762 
         struct screen                   *s = &data->screen;          struct screen                   *s = &data->screen;
         u_int                            i;          u_int                            i;
   
         /*  
          * xterm mouse mode is fairly silly. Buttons are in the bottom two  
          * bits: 0 button 1; 1 button 2; 2 button 3; 3 buttons released.  
          *  
          * Bit 3 is shift; bit 4 is meta; bit 5 control.  
          *  
          * Bit 6 is added for mouse buttons 4 and 5.  
          */  
   
         if (m->x >= screen_size_x(s))          if (m->x >= screen_size_x(s))
                 return;                  return;
         if (m->y >= screen_size_y(s))          if (m->y >= screen_size_y(s))
                 return;                  return;
   
         /* If mouse wheel (buttons 4 and 5), scroll. */          /* If mouse wheel (buttons 4 and 5), scroll. */
         if ((m->b & 64) == 64) {          if ((m->b & MOUSE_45)) {
                 if ((m->b & 3) == 0) {                  if ((m->b & MOUSE_BUTTON) == MOUSE_1) {
                         for (i = 0; i < 5; i++)                          for (i = 0; i < 5; i++)
                                 window_copy_cursor_up(wp, 0);                                  window_copy_cursor_up(wp, 0);
                 } else if ((m->b & 3) == 1) {                  } else if ((m->b & MOUSE_BUTTON) == MOUSE_2) {
                         for (i = 0; i < 5; i++)                          for (i = 0; i < 5; i++)
                                 window_copy_cursor_down(wp, 0);                                  window_copy_cursor_down(wp, 0);
                 }                  }
Line 793 
Line 784 
          * pressed, or stop the selection on their release.           * pressed, or stop the selection on their release.
          */           */
         if (s->mode & MODE_MOUSEMOTION) {          if (s->mode & MODE_MOUSEMOTION) {
                 if ((m->b & 3) != 3) {                  if ((m->b & MOUSE_BUTTON) != MOUSE_UP) {
                         window_copy_update_cursor(wp, m->x, m->y);                          window_copy_update_cursor(wp, m->x, m->y);
                         if (window_copy_update_selection(wp))                          if (window_copy_update_selection(wp))
                                 window_copy_redraw_screen(wp);                                  window_copy_redraw_screen(wp);
Line 808 
Line 799 
         }          }
   
         /* Otherwise i other buttons pressed, start selection and motion. */          /* Otherwise i other buttons pressed, start selection and motion. */
         if ((m->b & 3) != 3) {          if ((m->b & MOUSE_BUTTON) != MOUSE_UP) {
                 s->mode |= MODE_MOUSEMOTION;                  s->mode |= MODE_MOUSEMOTION;
   
                 window_copy_update_cursor(wp, m->x, m->y);                  window_copy_update_cursor(wp, m->x, m->y);

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60