home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / old / 5.6.038 < prev    next >
Encoding:
Internet Message Format  |  2000-03-28  |  4.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.6.038
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.6.038
  8. Problem:    Multi-clicks in GUI are interpreted as a mouse wheel click.  When
  9.             'ttymouse' is "xterm" a mouse click is interpreted as a mouse
  10.             wheel click.
  11. Solution:   Don't recognize the mouse wheel in check_termcode() in the GUI.
  12.             Use 0x43 for a mouse drag in do_xterm_trace(), not 0x63.
  13. Files:      src/term.c, src/os_unix.c
  14.  
  15.  
  16. *** ../vim-5.6.37/src/term.c    Sat Mar 25 20:39:12 2000
  17. --- src/term.c    Tue Mar 28 17:40:05 2000
  18. ***************
  19. *** 3148,3153 ****
  20. --- 3148,3154 ----
  21.       int        mouse_code = 0;        /* init for GCC */
  22.       int        modifiers;
  23.       int        is_click, is_drag;
  24. +     int        wheel_code = 0;
  25.       int        current_button;
  26.       static int    held_button = MOUSE_RELEASE;
  27.       static int    orig_num_clicks = 1;
  28. ***************
  29. *** 3371,3397 ****
  30.           slen += num_bytes;
  31.   
  32.           /*
  33. !          * Handle mouse events other than using the mouse wheel.
  34.            */
  35.   #  ifdef UNIX
  36. !         if (use_xterm_mouse() > 1)
  37.           {
  38. !             if ((mouse_code & MOUSE_DRAG_XTERM)
  39. !                            && mouse_code < MOUSEWHEEL_LOW)
  40.               mouse_code |= MOUSE_DRAG;
  41.           }
  42.   #  endif
  43.   #  ifdef XTERM_CLIP
  44. !         else
  45.           {
  46. !             if (!(mouse_code & MOUSE_DRAG & ~MOUSE_CLICK_MASK)
  47. !                            && mouse_code < MOUSEWHEEL_LOW)
  48. !             {
  49. !             if ((mouse_code & MOUSE_RELEASE) == MOUSE_RELEASE)
  50. !                 stop_xterm_trace();
  51. !             else
  52. !                 start_xterm_trace(mouse_code);
  53. !             }
  54.           }
  55.   #  endif
  56.           }
  57. --- 3372,3405 ----
  58.           slen += num_bytes;
  59.   
  60.           /*
  61. !          * Handle mouse events.
  62. !          * Recognize the xterm mouse wheel, but not in the GUI
  63. !          * (multi-clicks use >= 0x60).
  64.            */
  65. +         if (mouse_code >= MOUSEWHEEL_LOW
  66. + #ifdef USE_GUI
  67. +             && !gui.in_use
  68. + #endif
  69. +             )
  70. +         {
  71. +             /* Keep the mouse_code before it's changed, so that we
  72. +              * remember that it was a mouse wheel click. */
  73. +             wheel_code = mouse_code;
  74. +         }
  75.   #  ifdef UNIX
  76. !         else if (use_xterm_mouse() > 1)
  77.           {
  78. !             if (mouse_code & MOUSE_DRAG_XTERM)
  79.               mouse_code |= MOUSE_DRAG;
  80.           }
  81.   #  endif
  82.   #  ifdef XTERM_CLIP
  83. !         else if (!(mouse_code & MOUSE_DRAG & ~MOUSE_CLICK_MASK))
  84.           {
  85. !             if ((mouse_code & MOUSE_RELEASE) == MOUSE_RELEASE)
  86. !             stop_xterm_trace();
  87. !             else
  88. !             start_xterm_trace(mouse_code);
  89.           }
  90.   #  endif
  91.           }
  92. ***************
  93. *** 3574,3580 ****
  94.               is_drag = TRUE;
  95.           current_button = held_button;
  96.           }
  97. !         else if (mouse_code < MOUSEWHEEL_LOW)
  98.           {
  99.   # if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
  100.   #  ifdef GPM_MOUSE
  101. --- 3582,3588 ----
  102.               is_drag = TRUE;
  103.           current_button = held_button;
  104.           }
  105. !         else if (wheel_code == 0)
  106.           {
  107.   # if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
  108.   #  ifdef GPM_MOUSE
  109. ***************
  110. *** 3659,3666 ****
  111.   
  112.           /* Work out our pseudo mouse event */
  113.           key_name[0] = (int)KS_EXTRA;
  114. !         if (mouse_code >= MOUSEWHEEL_LOW)
  115. !         key_name[1] = (mouse_code & 1) ? KE_MOUSEUP : KE_MOUSEDOWN;
  116.           else
  117.           key_name[1] = get_pseudo_mouse_code(current_button,
  118.                                  is_click, is_drag);
  119. --- 3667,3674 ----
  120.   
  121.           /* Work out our pseudo mouse event */
  122.           key_name[0] = (int)KS_EXTRA;
  123. !         if (wheel_code != 0)
  124. !         key_name[1] = (wheel_code & 1) ? KE_MOUSEUP : KE_MOUSEDOWN;
  125.           else
  126.           key_name[1] = get_pseudo_mouse_code(current_button,
  127.                                  is_click, is_drag);
  128. *** ../vim-5.6.37/src/os_unix.c    Thu Mar 23 17:46:04 2000
  129. --- src/os_unix.c    Tue Mar 28 17:39:35 2000
  130. ***************
  131. *** 4038,4044 ****
  132.   
  133.       STRCPY(buf, mouse_code);
  134.       strp = buf + STRLEN(buf);
  135. !     *strp++ = xterm_button | MOUSE_DRAG;
  136.       *strp++ = (char_u)(col + ' ' + 1);
  137.       *strp++ = (char_u)(row + ' ' + 1);
  138.       *strp = 0;
  139. --- 4038,4044 ----
  140.   
  141.       STRCPY(buf, mouse_code);
  142.       strp = buf + STRLEN(buf);
  143. !     *strp++ = (xterm_button | MOUSE_DRAG) & ~0x20;
  144.       *strp++ = (char_u)(col + ' ' + 1);
  145.       *strp++ = (char_u)(row + ' ' + 1);
  146.       *strp = 0;
  147. *** ../vim-5.6.37/src/version.c    Tue Mar 28 11:58:41 2000
  148. --- src/version.c    Tue Mar 28 16:23:09 2000
  149. ***************
  150. *** 420,421 ****
  151. --- 420,423 ----
  152.   {   /* Add new patch number below this line */
  153. + /**/
  154. +     38,
  155.   /**/
  156.  
  157. -- 
  158. Q: Is selling software the same as selling hardware?
  159. A: No, good hardware is sold new, good software has already been used by many.
  160.  
  161. /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\
  162. \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
  163.