changeset 11508:9b1077d33c68 v8.0.0637

patch 8.0.0637: crash when using some version of GTK 3 commit https://github.com/vim/vim/commit/21b34b63b3f63dd54b338c4433fa7117dad9507b Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 13 14:34:01 2017 +0200 patch 8.0.0637: crash when using some version of GTK 3 Problem: Crash when using some version of GTK 3. Solution: Add #ifdefs around incrementing the menu index. (Kazunobu Kuriyama)
author Christian Brabandt <cb@256bit.org>
date Tue, 13 Jun 2017 14:45:03 +0200
parents 00082879b93d
children 408e0db898d9
files src/gui_gtk.c src/version.c
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/gui_gtk.c
+++ b/src/gui_gtk.c
@@ -652,9 +652,11 @@ gui_mch_add_menu(vimmenu_T *menu, int id
     parent_widget = (parent != NULL) ? parent->submenu_id : gui.menubar;
     menu_item_new(menu, parent_widget);
 
+# if !GTK_CHECK_VERSION(3,4,0)
     /* since the tearoff should always appear first, increment idx */
     if (parent != NULL && !menu_is_popup(parent->name))
 	++idx;
+# endif
 
     gtk_menu_shell_insert(GTK_MENU_SHELL(parent_widget), menu->id, idx);
 
@@ -773,10 +775,12 @@ gui_mch_add_menu_item(vimmenu_T *menu, i
 	if (parent == NULL || parent->submenu_id == NULL)
 	    return;
 
+# if !GTK_CHECK_VERSION(3,4,0)
 	/* Make place for the possible tearoff handle item.  Not in the popup
 	 * menu, it doesn't have a tearoff item. */
 	if (!menu_is_popup(parent->name))
 	    ++idx;
+# endif
 
 	if (menu_is_separator(menu->name))
 	{
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    637,
+/**/
     636,
 /**/
     635,