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 / 6.0.048 < prev    next >
Encoding:
Internet Message Format  |  2001-10-30  |  3.4 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.048
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.048
  11. Problem:    Win32: In the console the mouse doesn't always work correctly.
  12.         Sometimes after getting focus a mouse movement is interpreted like
  13.         a button click.
  14. Solution:   Use a different function to obtain the number of mouse buttons.
  15.         Avoid recognizing a button press from undefined bits. (Vince Negri)
  16. Files:        src/os_win32.c
  17.  
  18.  
  19. *** ../vim60.47/src/os_win32.c    Fri Sep 21 11:46:49 2001
  20. --- src/os_win32.c    Wed Oct 31 15:19:44 2001
  21. ***************
  22. *** 768,773 ****
  23. --- 768,775 ----
  24.       static s_dwLastClickTime = 0;
  25.       static BOOL s_fNextIsMiddle = FALSE;
  26.   
  27. +     static int cButtons = 0;    /* number of buttons supported */
  28.       const DWORD LEFT = FROM_LEFT_1ST_BUTTON_PRESSED;
  29.       const DWORD MIDDLE = FROM_LEFT_2ND_BUTTON_PRESSED;
  30.       const DWORD RIGHT = RIGHTMOST_BUTTON_PRESSED;
  31. ***************
  32. *** 775,780 ****
  33. --- 777,785 ----
  34.   
  35.       int nButton;
  36.   
  37. +     if (cButtons == 0 && !GetNumberOfConsoleMouseButtons(&cButtons))
  38. +     cButtons = 2;
  39.       if (!g_fMouseAvail || !g_fMouseActive)
  40.       {
  41.       g_nMouseClick = -1;
  42. ***************
  43. *** 805,811 ****
  44.       }
  45.   
  46.       /* If no buttons are pressed... */
  47. !     if (pmer->dwButtonState == 0)
  48.       {
  49.       /* If the last thing returned was MOUSE_RELEASE, ignore this */
  50.       if (s_fReleased)
  51. --- 810,816 ----
  52.       }
  53.   
  54.       /* If no buttons are pressed... */
  55. !     if ((pmer->dwButtonState & ((1 << cButtons) - 1)) == 0)
  56.       {
  57.       /* If the last thing returned was MOUSE_RELEASE, ignore this */
  58.       if (s_fReleased)
  59. ***************
  60. *** 816,823 ****
  61.       }
  62.       else    /* one or more buttons pressed */
  63.       {
  64. -     const int cButtons = GetSystemMetrics(SM_CMOUSEBUTTONS);
  65.       /* on a 2-button mouse, hold down left and right buttons
  66.        * simultaneously to get MIDDLE. */
  67.   
  68. --- 821,826 ----
  69. ***************
  70. *** 1198,1204 ****
  71.   
  72.   #ifdef FEAT_CLIENTSERVER
  73.       (void)WaitForChar(-1L);
  74. !     if (!vim_is_input_buf_empty())
  75.           return 0;
  76.   #endif
  77.       if (ReadConsoleInput(g_hConIn, &ir, 1, &cRecords) == 0)
  78. --- 1201,1207 ----
  79.   
  80.   #ifdef FEAT_CLIENTSERVER
  81.       (void)WaitForChar(-1L);
  82. !     if (!vim_is_input_buf_empty() || g_nMouseClick != -1)
  83.           return 0;
  84.   #endif
  85.       if (ReadConsoleInput(g_hConIn, &ir, 1, &cRecords) == 0)
  86. ***************
  87. *** 1266,1272 ****
  88.           want_sniff_request = 0;
  89.           return len;
  90.       }
  91. !     else if(time < 0 || time > 250)
  92.       {
  93.           /* don't wait too long, a request might be pending */
  94.           time = 250;
  95. --- 1269,1275 ----
  96.           want_sniff_request = 0;
  97.           return len;
  98.       }
  99. !     else if (time < 0 || time > 250)
  100.       {
  101.           /* don't wait too long, a request might be pending */
  102.           time = 250;
  103. *** ../vim60.47/src/version.c    Wed Oct 31 15:17:54 2001
  104. --- src/version.c    Wed Oct 31 15:17:29 2001
  105. ***************
  106. *** 608,609 ****
  107. --- 608,611 ----
  108.   {   /* Add new patch number below this line */
  109. + /**/
  110. +     48,
  111.   /**/
  112.  
  113. -- 
  114. A law to reduce crime states: "It is mandatory for a motorist with criminal
  115. intentions to stop at the city limits and telephone the chief of police as he
  116. is entering the town.
  117.         [real standing law in Washington, United States of America]
  118.  
  119.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  120. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  121.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  122.