1
0
forked from aniani/vim

patch 8.2.1713: Motif GUI: crash when setting menu colors

Problem:    Motif GUI: crash when setting menu colors. (Andrzej Bylicki)
Solution:   Add {} to make "n" incremented correctly. (closes #6989,
            closes #5948)
This commit is contained in:
Bram Moolenaar
2020-09-20 19:57:15 +02:00
parent 1d59aa1fdf
commit 7795bfea6d
2 changed files with 6 additions and 0 deletions

View File

@@ -916,9 +916,13 @@ gui_mch_add_menu(vimmenu_T *menu, int idx)
# endif # endif
{ {
if (gui.menu_bg_pixel != INVALCOLOR) if (gui.menu_bg_pixel != INVALCOLOR)
{
XtSetArg(arg[0], XmNbackground, gui.menu_bg_pixel); n++; XtSetArg(arg[0], XmNbackground, gui.menu_bg_pixel); n++;
}
if (gui.menu_fg_pixel != INVALCOLOR) if (gui.menu_fg_pixel != INVALCOLOR)
{
XtSetArg(arg[1], XmNforeground, gui.menu_fg_pixel); n++; XtSetArg(arg[1], XmNforeground, gui.menu_fg_pixel); n++;
}
menu->submenu_id = XmCreatePopupMenu(textArea, "contextMenu", menu->submenu_id = XmCreatePopupMenu(textArea, "contextMenu",
arg, n); arg, n);
menu->id = (Widget)0; menu->id = (Widget)0;

View File

@@ -750,6 +750,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 */
/**/
1713,
/**/ /**/
1712, 1712,
/**/ /**/