diff --git a/ChangeLog b/ChangeLog index 94cd3afe2..be7b7921b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-07-17 German A. Arias + + * Source/NSPopUpButtonCell.m (-attachPopUpWithFrame:inView:): Ensure + the window responds when run in modal and should process events. + 2013-07-15 Riccardo Mottola * Images/nsmapping.strings diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index a85f51b45..5470f0d46 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -36,6 +36,7 @@ #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuView.h" +#import "AppKit/NSPanel.h" #import "AppKit/NSPopUpButton.h" #import "AppKit/NSPopUpButtonCell.h" #import "AppKit/NSWindow.h" @@ -909,6 +910,21 @@ static NSImage *_pbc_image[5]; [nc postNotificationName: NSPopUpButtonWillPopUpNotification object: controlView]; + /* Ensure the window responds when run in modal and should + * process events. Or revert this if theme has changed. + */ + if ([[GSTheme theme] doesProcessEventsForPopUpMenu] && + ![[_menu window] worksWhenModal]) + { + [(NSPanel *)[_menu window] setWorksWhenModal: YES]; + } + + if (![[GSTheme theme] doesProcessEventsForPopUpMenu] && + [[_menu window] worksWhenModal]) + { + [(NSPanel *)[_menu window] setWorksWhenModal: NO]; + } + // Convert to Screen Coordinates cellFrame = [controlView convertRect: cellFrame toView: nil]; cellFrame.origin = [cvWin convertBaseToScreen: cellFrame.origin];