Skip to content

Commit 21b34b6

Browse files
committed
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)
1 parent 56f2db5 commit 21b34b6

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/gui_gtk.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,11 @@ gui_mch_add_menu(vimmenu_T *menu, int idx)
652652
parent_widget = (parent != NULL) ? parent->submenu_id : gui.menubar;
653653
menu_item_new(menu, parent_widget);
654654

655+
# if !GTK_CHECK_VERSION(3,4,0)
655656
/* since the tearoff should always appear first, increment idx */
656657
if (parent != NULL && !menu_is_popup(parent->name))
657658
++idx;
659+
# endif
658660

659661
gtk_menu_shell_insert(GTK_MENU_SHELL(parent_widget), menu->id, idx);
660662

@@ -773,10 +775,12 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx)
773775
if (parent == NULL || parent->submenu_id == NULL)
774776
return;
775777

778+
# if !GTK_CHECK_VERSION(3,4,0)
776779
/* Make place for the possible tearoff handle item. Not in the popup
777780
* menu, it doesn't have a tearoff item. */
778781
if (!menu_is_popup(parent->name))
779782
++idx;
783+
# endif
780784

781785
if (menu_is_separator(menu->name))
782786
{

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
637,
767769
/**/
768770
636,
769771
/**/

0 commit comments

Comments
 (0)