diff --git a/ChangeLog b/ChangeLog index 562afe2ba..d3813a4c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-01-15 23:50-EST Gregory John Casamento + + * Source/NSMenuView.m: Fix to previous change to + [NSMenuView _executeItemAtIndex:removeSubmenu:]. + Assign attachedMenu to local variable and test for nil + prior to entering the code to close the menu when tracking + the mouse for normal menus. Previous version of this code + was causing menu items owned by pull downs (NSPopUpButton) to + close prior to mouse up event. + 2011-01-15 German Arias * Source/NSWindow.m: diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index faf88a7bd..40ceaa927 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -1586,6 +1586,7 @@ static NSMapTable *viewInfo = 0; NSPoint locationInScreenCoordinates; NSWindow *windowUnderMouse; NSMenu *candidateMenu; + NSMenu *anAttachedMenu = [[[NSApp mainWindow] menu] attachedMenu]; subMenusNeedRemoving = NO; @@ -1656,7 +1657,8 @@ static NSMapTable *viewInfo = 0; /*We track the menu correctly when this is located in a window*/ if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self) == - NSWindows95InterfaceStyle) + NSWindows95InterfaceStyle && + anAttachedMenu != nil) { if ([self hitTest: location] == nil) { @@ -1667,7 +1669,7 @@ static NSMapTable *viewInfo = 0; if (space == 2) { - [[[[NSApp mainWindow] menu] attachedMenu] close]; + [anAttachedMenu close]; shouldFinish = YES; return NO; }