mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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)
This commit is contained in:
parent
56f2db562d
commit
21b34b63b3
@ -652,9 +652,11 @@ gui_mch_add_menu(vimmenu_T *menu, int idx)
|
|||||||
parent_widget = (parent != NULL) ? parent->submenu_id : gui.menubar;
|
parent_widget = (parent != NULL) ? parent->submenu_id : gui.menubar;
|
||||||
menu_item_new(menu, parent_widget);
|
menu_item_new(menu, parent_widget);
|
||||||
|
|
||||||
|
# if !GTK_CHECK_VERSION(3,4,0)
|
||||||
/* since the tearoff should always appear first, increment idx */
|
/* since the tearoff should always appear first, increment idx */
|
||||||
if (parent != NULL && !menu_is_popup(parent->name))
|
if (parent != NULL && !menu_is_popup(parent->name))
|
||||||
++idx;
|
++idx;
|
||||||
|
# endif
|
||||||
|
|
||||||
gtk_menu_shell_insert(GTK_MENU_SHELL(parent_widget), menu->id, idx);
|
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)
|
if (parent == NULL || parent->submenu_id == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
# if !GTK_CHECK_VERSION(3,4,0)
|
||||||
/* Make place for the possible tearoff handle item. Not in the popup
|
/* Make place for the possible tearoff handle item. Not in the popup
|
||||||
* menu, it doesn't have a tearoff item. */
|
* menu, it doesn't have a tearoff item. */
|
||||||
if (!menu_is_popup(parent->name))
|
if (!menu_is_popup(parent->name))
|
||||||
++idx;
|
++idx;
|
||||||
|
# endif
|
||||||
|
|
||||||
if (menu_is_separator(menu->name))
|
if (menu_is_separator(menu->name))
|
||||||
{
|
{
|
||||||
|
@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
637,
|
||||||
/**/
|
/**/
|
||||||
636,
|
636,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user