Patch 8.0.0872
Problem:    Using mouse scroll while a terminal window has focus and the mouse
            pointer is on another window does not work.  Same for focus in a
            non-terminal window ahd the mouse pointer is over a terminal
            window.
Solution:   Send the scroll action to the right window.
Files:      src/terminal.c, src/normal.c, src/proto/terminal.pro


*** ../vim-8.0.0871/src/terminal.c      2017-08-05 18:02:17.158202722 +0200
--- src/terminal.c      2017-08-05 18:46:05.134202653 +0200
***************
*** 37,43 ****
   *
   * TODO:
   * - MS-Windows: no redraw for 'updatetime'  #1915
-  * - mouse scroll: when over other window, scroll that window.
   * - add argument to term_wait() for waiting time.
   * - For the scrollback buffer store lines in the buffer, only attributes in
   *   tl_scrollback.
--- 37,42 ----
***************
*** 909,915 ****
   * Return FAIL when the key needs to be handled in Normal mode.
   * Return OK when the key was dropped or sent to the terminal.
   */
!     static int
  send_keys_to_term(term_T *term, int c, int typed)
  {
      char      msg[KEY_BUF_LEN];
--- 908,914 ----
   * Return FAIL when the key needs to be handled in Normal mode.
   * Return OK when the key was dropped or sent to the terminal.
   */
!     int
  send_keys_to_term(term_T *term, int c, int typed)
  {
      char      msg[KEY_BUF_LEN];
***************
*** 948,960 ****
        case K_X1RELEASE:
        case K_X2MOUSE:
        case K_X2RELEASE:
            if (mouse_row < W_WINROW(curwin)
                    || mouse_row >= (W_WINROW(curwin) + curwin->w_height)
                    || mouse_col < W_WINCOL(curwin)
                    || mouse_col >= W_ENDCOL(curwin)
                    || dragging_outside)
            {
!               /* click outside the current window */
                if (typed)
                {
                    stuffcharReadbuff(c);
--- 947,964 ----
        case K_X1RELEASE:
        case K_X2MOUSE:
        case K_X2RELEASE:
+ 
+       case K_MOUSEUP:
+       case K_MOUSEDOWN:
+       case K_MOUSELEFT:
+       case K_MOUSERIGHT:
            if (mouse_row < W_WINROW(curwin)
                    || mouse_row >= (W_WINROW(curwin) + curwin->w_height)
                    || mouse_col < W_WINCOL(curwin)
                    || mouse_col >= W_ENDCOL(curwin)
                    || dragging_outside)
            {
!               /* click or scroll outside the current window */
                if (typed)
                {
                    stuffcharReadbuff(c);
*** ../vim-8.0.0871/src/normal.c        2017-08-03 22:44:51.046797665 +0200
--- src/normal.c        2017-08-05 18:44:54.750732074 +0200
***************
*** 4638,4643 ****
--- 4638,4648 ----
  
      if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
      {
+ # ifdef FEAT_TERMINAL
+       if (term_use_loop())
+           send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE);
+       else
+ # endif
        if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
        {
            (void)onepage(cap->arg ? FORWARD : BACKWARD, 1L);
*** ../vim-8.0.0871/src/proto/terminal.pro      2017-08-03 13:51:02.384784816 
+0200
--- src/proto/terminal.pro      2017-08-05 18:45:14.482583262 +0200
***************
*** 5,10 ****
--- 5,11 ----
  int term_job_running(term_T *term);
  int term_in_terminal_mode(void);
  void term_leave_terminal_mode(void);
+ int send_keys_to_term(term_T *term, int c, int typed);
  int term_use_loop(void);
  int terminal_loop(void);
  void term_job_ended(job_T *job);
*** ../vim-8.0.0871/src/version.c       2017-08-05 18:19:51.050143054 +0200
--- src/version.c       2017-08-05 19:34:05.656690367 +0200
***************
*** 771,772 ****
--- 771,774 ----
  {   /* Add new patch number below this line */
+ /**/
+     872,
  /**/

-- 
Time flies like an arrow.
Fruit flies like a banana.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui