Revert last change and implement a better solution.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37157 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2013-09-27 04:33:30 +00:00
parent 5559a2dfd1
commit 4877916592
4 changed files with 14 additions and 27 deletions

View file

@ -1,3 +1,14 @@
2013-09-26 German Arias <germanandre@gmx.es>
* 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 <germanandre@gmx.es>
* Source/GSThemeMenu.m (-displayPopUpMenu:withCellFrame:...): If the

View file

@ -30,7 +30,6 @@
#import <Foundation/NSArchiver.h>
#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]

View file

@ -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.

View file

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