[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.210 and 1.211

version 1.210, 2019/03/08 10:34:20 version 1.211, 2019/03/12 11:16:50
Line 258 
Line 258 
   
         data = window_copy_common_init(wme);          data = window_copy_common_init(wme);
   
         if (wp->fd != -1)          if (wp->fd != -1 && wp->disabled++ == 0)
                 bufferevent_disable(wp->event, EV_READ|EV_WRITE);                  bufferevent_disable(wp->event, EV_READ|EV_WRITE);
   
         data->backing = &wp->base;          data->backing = &wp->base;
Line 302 
Line 302 
         struct window_pane              *wp = wme->wp;          struct window_pane              *wp = wme->wp;
         struct window_copy_mode_data    *data = wme->data;          struct window_copy_mode_data    *data = wme->data;
   
         if (wp->fd != -1)          if (wp->fd != -1 && --wp->disabled == 0)
                 bufferevent_enable(wp->event, EV_READ|EV_WRITE);                  bufferevent_enable(wp->event, EV_READ|EV_WRITE);
   
         free(data->searchmark);          free(data->searchmark);
Line 330 
Line 330 
 void  void
 window_copy_vadd(struct window_pane *wp, const char *fmt, va_list ap)  window_copy_vadd(struct window_pane *wp, const char *fmt, va_list ap)
 {  {
         struct window_mode_entry        *wme = wp->mode;          struct window_mode_entry        *wme = TAILQ_FIRST(&wp->modes);
         struct window_copy_mode_data    *data = wme->data;          struct window_copy_mode_data    *data = wme->data;
         struct screen                   *backing = data->backing;          struct screen                   *backing = data->backing;
         struct screen_write_ctx          back_ctx, ctx;          struct screen_write_ctx          back_ctx, ctx;
Line 377 
Line 377 
 void  void
 window_copy_pageup(struct window_pane *wp, int half_page)  window_copy_pageup(struct window_pane *wp, int half_page)
 {  {
         window_copy_pageup1(wp->mode, half_page);          window_copy_pageup1(TAILQ_FIRST(&wp->modes), half_page);
 }  }
   
 static void  static void
Line 2540 
Line 2540 
 static void  static void
 window_copy_move_mouse(struct mouse_event *m)  window_copy_move_mouse(struct mouse_event *m)
 {  {
         struct window_pane      *wp;          struct window_pane              *wp;
         u_int                    x, y;          struct window_mode_entry        *wme;
           u_int                            x, y;
   
         wp = cmd_mouse_pane(m, NULL, NULL);          wp = cmd_mouse_pane(m, NULL, NULL);
         if (wp == NULL ||          if (wp == NULL)
             wp->mode == NULL ||  
             wp->mode->mode != &window_copy_mode)  
                 return;                  return;
           wme = TAILQ_FIRST(&wp->modes);
           if (wme == NULL || wme->mode != &window_copy_mode)
                   return;
   
         if (cmd_mouse_at(wp, m, &x, &y, 0) != 0)          if (cmd_mouse_at(wp, m, &x, &y, 0) != 0)
                 return;                  return;
   
         window_copy_update_cursor(wp->mode, x, y);          window_copy_update_cursor(wme, x, y);
 }  }
   
 void  void
 window_copy_start_drag(struct client *c, struct mouse_event *m)  window_copy_start_drag(struct client *c, struct mouse_event *m)
 {  {
         struct window_pane      *wp;          struct window_pane              *wp;
         u_int                    x, y;          struct window_mode_entry        *wme;
           u_int                            x, y;
   
         if (c == NULL)          if (c == NULL)
                 return;                  return;
   
         wp = cmd_mouse_pane(m, NULL, NULL);          wp = cmd_mouse_pane(m, NULL, NULL);
         if (wp == NULL ||          if (wp == NULL)
             wp->mode == NULL ||  
             wp->mode->mode != &window_copy_mode)  
                 return;                  return;
           wme = TAILQ_FIRST(&wp->modes);
           if (wme == NULL || wme->mode != &window_copy_mode)
                   return;
   
         if (cmd_mouse_at(wp, m, &x, &y, 1) != 0)          if (cmd_mouse_at(wp, m, &x, &y, 1) != 0)
                 return;                  return;
Line 2576 
Line 2580 
         c->tty.mouse_drag_update = window_copy_drag_update;          c->tty.mouse_drag_update = window_copy_drag_update;
         c->tty.mouse_drag_release = NULL; /* will fire MouseDragEnd key */          c->tty.mouse_drag_release = NULL; /* will fire MouseDragEnd key */
   
         window_copy_update_cursor(wp->mode, x, y);          window_copy_update_cursor(wme, x, y);
         window_copy_start_selection(wp->mode);          window_copy_start_selection(wme);
         window_copy_redraw_screen(wp->mode);          window_copy_redraw_screen(wme);
 }  }
   
 static void  static void
 window_copy_drag_update(__unused struct client *c, struct mouse_event *m)  window_copy_drag_update(struct client *c, struct mouse_event *m)
 {  {
         struct window_pane              *wp;          struct window_pane              *wp;
           struct window_mode_entry        *wme;
         struct window_copy_mode_data    *data;          struct window_copy_mode_data    *data;
         u_int                            x, y, old_cy;          u_int                            x, y, old_cy;
   
           if (c == NULL)
                   return;
   
         wp = cmd_mouse_pane(m, NULL, NULL);          wp = cmd_mouse_pane(m, NULL, NULL);
         if (wp == NULL ||          if (wp == NULL)
             wp->mode == NULL ||  
             wp->mode->mode != &window_copy_mode)  
                 return;                  return;
         data = wp->mode->data;          wme = TAILQ_FIRST(&wp->modes);
           if (wme == NULL || wme->mode != &window_copy_mode)
                   return;
           data = wme->data;
   
         if (cmd_mouse_at(wp, m, &x, &y, 0) != 0)          if (cmd_mouse_at(wp, m, &x, &y, 0) != 0)
                 return;                  return;
         old_cy = data->cy;          old_cy = data->cy;
   
         window_copy_update_cursor(wp->mode, x, y);          window_copy_update_cursor(wme, x, y);
         if (window_copy_update_selection(wp->mode, 1))          if (window_copy_update_selection(wme, 1))
                 window_copy_redraw_selection(wp->mode, old_cy);                  window_copy_redraw_selection(wme, old_cy);
 }  }

Legend:
Removed from v.1.210  
changed lines
  Added in v.1.211