changeset 79608:a2a0cc9de288

(fill_menubar) [MAC_OSX]: Add workaround for Mac OS X 10.5 about not changing Help menu title.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Sun, 23 Dec 2007 06:01:22 +0000
parents ef7ca6ec0262
children 8c9a5282bc08
files src/macmenu.c
diffstat 1 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/macmenu.c	Sun Dec 23 06:00:36 2007 +0000
+++ b/src/macmenu.c	Sun Dec 23 06:01:22 2007 +0000
@@ -3174,7 +3174,22 @@
 
 	  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 @@
 	    }
 #endif  /* !TARGET_API_MAC_CARBON */
 	}
-      else
+
+      if (!menu)
 	{
 	  menu = NewMenu (id, title);
 	  InsertMenu (menu, 0);