diff --git a/ChangeLog b/ChangeLog index 00932b410..9ba03ddd9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2013-09-26 German Arias + + * Source/GSThemeMenu.m (-displayPopUpMenu:withCellFrame:...): Revert + last change, this don't prevent users open two or more popups at + same time. + * Source/NSPopUpButtonCell.m (-trackMouse:inRect:ofView:untilMouseUp:): + Don't check here if theme process events, this avoid NSMenuView + process correctly the events. + * Source/NSMenuView.m (- _trackWithEvent:startingMenuView:): Ignore + the first mouse up if is a popup and theme process events. + 2013-09-24 German Arias * Source/GSThemeMenu.m (-displayPopUpMenu:withCellFrame:...): If the diff --git a/Source/GSThemeMenu.m b/Source/GSThemeMenu.m index 4af9e95c0..3feb815d4 100644 --- a/Source/GSThemeMenu.m +++ b/Source/GSThemeMenu.m @@ -30,7 +30,6 @@ #import #import "AppKit/NSMenu.h" #import "AppKit/NSPanel.h" -#import "AppKit/NSPopUpButtonCell.h" #import "AppKit/NSWindow.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSApplication.h" @@ -41,22 +40,12 @@ #import "NSToolbarFrameworkPrivate.h" #import "GSGuiPrivate.h" -@interface NSMenu (PopUp) -- (NSPopUpButtonCell *)owningPopUp; -@end @interface NSWindow (Private) - (GSWindowDecorationView *) windowView; - (void) _setMenu: (NSMenu *)menu; @end -@implementation NSMenu (PopUp) -- (NSPopUpButtonCell *)owningPopUp -{ - return _popUpButtonCell; -} -@end - @implementation NSWindow (Private) - (GSWindowDecorationView *) windowView { @@ -132,17 +121,6 @@ [(NSPanel *)[mr window] setWorksWhenModal: NO]; } - /* This is for pulldown PopUp when the theme process events. - * If the popup is currently displayed, close it. If not, the - * user only can close it choosing one option at menu. - */ - if (pe && [[mr window] isVisible] && - [[mr menu] owningPopUp] != nil) - { - [[[mr menu] owningPopUp] dismissPopUp]; - return; - } - // Ask the MenuView to attach the menu to this rect [mr setWindowFrameForAttachingToRect: cellFrame onScreen: [cvWin screen] diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index f00581566..f5fb54a61 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -1512,8 +1512,8 @@ static NSMapTable *viewInfo = 0; over the menu, the menu is closed when the user releases the mouse. On the other hand, when the user clicks on the button and then moves the mouse the menu is closed upon the next mouse click. */ - ([[self menu] _ownedByPopUp] && - style == NSMacintoshInterfaceStyle)) + ([[self menu] _ownedByPopUp] && (style == NSMacintoshInterfaceStyle || + [[GSTheme theme] doesProcessEventsForPopUpMenu]))) { /* * Ignore the first mouse up if nothing interesting has happened. diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index a85f51b45..a9bbd4885 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -1011,9 +1011,7 @@ static NSImage *_pbc_image[5]; // Attach the popUp [self attachPopUpWithFrame: cellFrame inView: controlView]; - if ([[GSTheme theme] doesProcessEventsForPopUpMenu]) - return YES; // the theme handles the events, so we're done - + p = [[controlView window] convertBaseToScreen: [theEvent locationInWindow]]; p = [menuWindow convertScreenToBase: p];