From 585a8772d5baf90ae9c85d046153e800a3f60235 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 23 Dec 2007 06:01:51 +0000 Subject: [PATCH] (fill_menubar) [MAC_OSX]: Add workaround for Mac OS X 10.5 about not changing Help menu title. --- src/ChangeLog | 5 +++++ src/macmenu.c | 20 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 284bca33828..fa3d8e78b05 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-12-23 YAMAMOTO Mitsuharu + + * macmenu.c (fill_menubar) [MAC_OSX]: Add workaround for Mac OS X 10.5 + about not changing Help menu title. + 2007-12-22 Eli Zaretskii * callint.c (syms_of_callint) : Add reference to diff --git a/src/macmenu.c b/src/macmenu.c index b8cfd6a4d2f..c7b63917a4c 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -3174,7 +3174,22 @@ fill_menubar (wv, deep_p) GetMenuTitle (menu, old_title); if (!EqualString (title, old_title, false, false)) - SetMenuTitle (menu, title); + { +#ifdef MAC_OSX + if (id + 1 == min_menu_id[MAC_MENU_MENU_BAR + 1] + || GetMenuRef (id + 1) == NULL) + { + /* This is a workaround for Mac OS X 10.5 where just + calling SetMenuTitle fails to change the title of + the last (Help) menu in the menu bar. */ + DeleteMenu (id); + DisposeMenu (menu); + menu = NULL; + } + else +#endif /* MAC_OSX */ + SetMenuTitle (menu, title); + } #else /* !TARGET_API_MAC_CARBON */ if (!EqualString (title, (*menu)->menuData, false, false)) { @@ -3186,7 +3201,8 @@ fill_menubar (wv, deep_p) } #endif /* !TARGET_API_MAC_CARBON */ } - else + + if (!menu) { menu = NewMenu (id, title); InsertMenu (menu, 0); -- 2.39.2