summaryrefslogtreecommitdiff
path: root/src/gui_gtk.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-13 14:34:01 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-13 14:34:01 +0200
commit21b34b63b3f63dd54b338c4433fa7117dad9507b (patch)
tree25b7145165aedf2eb8de81d01af2e5cfff3b26dd /src/gui_gtk.c
parent56f2db562ddc6c69026d55360f0cfaacd8adc26a (diff)
downloadvim-git-21b34b63b3f63dd54b338c4433fa7117dad9507b.tar.gz
patch 8.0.0637: crash when using some version of GTK 3v8.0.0637
Problem: Crash when using some version of GTK 3. Solution: Add #ifdefs around incrementing the menu index. (Kazunobu Kuriyama)
Diffstat (limited to 'src/gui_gtk.c')
-rw-r--r--src/gui_gtk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui_gtk.c b/src/gui_gtk.c
index c175dd31e..34069781a 100644
--- a/src/gui_gtk.c
+++ b/src/gui_gtk.c
@@ -652,9 +652,11 @@ gui_mch_add_menu(vimmenu_T *menu, int idx)
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, int idx)
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))
{