From ae6a133a8d5afca88ae4c374a1798b37305cce52 Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 18 Nov 2020 22:58:23 +0000 Subject: Fix [7185d26cf4]: macOS menu items before separators in special menus are disabled. --- macosx/tkMacOSXMenu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 3d5a996..29085a0 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -785,17 +785,17 @@ TkpConfigureMenuEntry( int i = 0; NSArray *itemArray = [submenu itemArray]; - for (NSMenuItem *item in itemArray) { TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i]; /* - * Work around an apparent bug where itemArray can have - * more items than the menu's entries[] array. + * if this is a special menu in a menubar, skip the + * first item, which will have been added by the system + * and will be unknown to Tk. */ - if (i >= (int) menuRefPtr->menuPtr->numEntries) { - break; + if (mePtr->entryFlags && i == 0) { + continue; } [item setEnabled: !(submePtr->state == ENTRY_DISABLED)]; i++; -- cgit v0.12