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 / 7.0 / 7.0.062 < prev    next >
Encoding:
Internet Message Format  |  2006-08-15  |  4.0 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.0.062
  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 7.0.062
  11. Problem:    Mac: Crash when using the popup menu for spell correction.  The
  12.         popup menu appears twice when letting go of the right mouse button
  13.         early.
  14. Solution:   Don't show the popup menu on the release of the right mouse
  15.         button.  Also check that a menu pointer is actually valid.
  16. Files:        src/proto/menu.pro, src/menu.c, src/normal.c, src/term.c
  17.  
  18.  
  19. *** ../vim-7.0.061/src/proto/menu.pro    Fri Mar 24 23:37:59 2006
  20. --- src/proto/menu.pro    Wed Aug 16 20:25:57 2006
  21. ***************
  22. *** 10,15 ****
  23. --- 10,16 ----
  24.   extern int menu_is_child_of_popup __ARGS((vimmenu_T *menu));
  25.   extern int menu_is_toolbar __ARGS((char_u *name));
  26.   extern int menu_is_separator __ARGS((char_u *name));
  27. + extern int check_menu_pointer __ARGS((vimmenu_T *root, vimmenu_T *menu_to_check));
  28.   extern void gui_create_initial_menus __ARGS((vimmenu_T *menu));
  29.   extern void gui_update_menus __ARGS((int modes));
  30.   extern int gui_is_menu_shortcut __ARGS((int key));
  31. *** ../vim-7.0.061/src/menu.c    Wed Aug 16 15:56:58 2006
  32. --- src/menu.c    Wed Aug 16 20:35:09 2006
  33. ***************
  34. *** 1778,1783 ****
  35. --- 1778,1804 ----
  36.   }
  37.   
  38.   /*
  39. +  * Check that a pointer appears in the menu tree.  Used to protect from using
  40. +  * a menu that was deleted after it was selected but before the event was
  41. +  * handled.
  42. +  * Return OK or FAIL.  Used recursively.
  43. +  */
  44. +     int
  45. + check_menu_pointer(root, menu_to_check)
  46. +     vimmenu_T *root;
  47. +     vimmenu_T *menu_to_check;
  48. + {
  49. +     vimmenu_T    *p;
  50. +     for (p = root; p != NULL; p = p->next)
  51. +     if (p == menu_to_check
  52. +         || (p->children != NULL
  53. +             && check_menu_pointer(p->children, menu_to_check) == OK))
  54. +         return OK;
  55. +     return FAIL;
  56. + }
  57. + /*
  58.    * After we have started the GUI, then we can create any menus that have been
  59.    * defined.  This is done once here.  add_menu_path() may have already been
  60.    * called to define these menus, and may be called again.  This function calls
  61. *** ../vim-7.0.061/src/normal.c    Sat Apr 29 23:53:55 2006
  62. --- src/normal.c    Wed Aug 16 19:54:04 2006
  63. ***************
  64. *** 2504,2510 ****
  65.            * NOTE: Ignore right button down and drag mouse events.
  66.            * Windows only shows the popup menu on the button up event.
  67.            */
  68. ! #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
  69.           if (!is_click)
  70.           return FALSE;
  71.   #endif
  72. --- 2504,2511 ----
  73.            * NOTE: Ignore right button down and drag mouse events.
  74.            * Windows only shows the popup menu on the button up event.
  75.            */
  76. ! #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
  77. !               || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)
  78.           if (!is_click)
  79.           return FALSE;
  80.   #endif
  81. *** ../vim-7.0.061/src/term.c    Wed May  3 23:26:49 2006
  82. --- src/term.c    Wed Aug 16 21:24:21 2006
  83. ***************
  84. *** 4783,4788 ****
  85. --- 4783,4796 ----
  86.           return -1;
  87.           current_menu = (vimmenu_T *)val;
  88.           slen += num_bytes;
  89. +         /* The menu may have been deleted right after it was used, check
  90. +          * for that. */
  91. +         if (check_menu_pointer(root_menu, current_menu) == FAIL)
  92. +         {
  93. +         key_name[0] = KS_EXTRA;
  94. +         key_name[1] = (int)KE_IGNORE;
  95. +         }
  96.       }
  97.   # endif
  98.   # ifdef FEAT_GUI_TABLINE
  99. *** ../vim-7.0.061/src/version.c    Wed Aug 16 21:26:19 2006
  100. --- src/version.c    Wed Aug 16 21:40:37 2006
  101. ***************
  102. *** 668,669 ****
  103. --- 668,671 ----
  104.   {   /* Add new patch number below this line */
  105. + /**/
  106. +     62,
  107.   /**/
  108.  
  109. -- 
  110. hundred-and-one symptoms of being an internet addict:
  111. 166. You have been on your computer soo long that you didn't realize
  112.      you had grandchildren.
  113.  
  114.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  115. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  116. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  117.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  118.