Improvements for PopUp when should process events.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36902 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2013-07-17 23:34:20 +00:00
parent 84475d435d
commit bb09eb6bca
2 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2013-07-17 German A. Arias <german@xelalug.org>
* Source/NSPopUpButtonCell.m (-attachPopUpWithFrame:inView:): Ensure
the window responds when run in modal and should process events.
2013-07-15 Riccardo Mottola <rm@gnu.org>
* Images/nsmapping.strings

View file

@ -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];