Revert last change

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38394 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2015-03-11 00:57:46 +00:00
parent 2df985f377
commit 687bada9e1
4 changed files with 5 additions and 70 deletions

View file

@ -95,7 +95,6 @@
BOOL _needsSizing; BOOL _needsSizing;
char _pad2[3]; char _pad2[3];
NSSize _cellSize; NSSize _cellSize;
BOOL _finished;
@private @private
id _items_link; id _items_link;

View file

@ -125,20 +125,17 @@
@interface NSMenuView (GNUstepPrivate) @interface NSMenuView (GNUstepPrivate)
- (NSArray *)_itemCells; - (NSArray *)_itemCells;
- (void)_finish;
@end @end
static NSZone *menuZone = NULL; static NSZone *menuZone = NULL;
static NSString *NSMenuLocationsKey = @"NSMenuLocations"; static NSString *NSMenuLocationsKey = @"NSMenuLocations";
static NSString *NSEnqueuedMenuMoveName = @"EnqueuedMoveNotificationName"; static NSString *NSEnqueuedMenuMoveName = @"EnqueuedMoveNotificationName";
static NSNotificationCenter *nc; static NSNotificationCenter *nc;
static BOOL menuBarVisible = YES; static BOOL menuBarVisible = YES;
static NSMenu *_CurrentMenu = nil;
@interface NSMenu (GNUstepPrivate) @interface NSMenu (GNUstepPrivate)
+ (NSMenu*)_currentMenu;
+ (void)_setCurrentMenu:(NSMenu*)menu;
- (NSString *) _name; - (NSString *) _name;
- (void) _setName: (NSString *)name; - (void) _setName: (NSString *)name;
- (NSMenuPanel *) _createWindow; - (NSMenuPanel *) _createWindow;
@ -147,7 +144,6 @@ static NSMenu *_CurrentMenu = nil;
- (void) _setGeometry; - (void) _setGeometry;
- (void) _updateUserDefaults: (id) notification; - (void) _updateUserDefaults: (id) notification;
- (void) _organizeMenu; - (void) _organizeMenu;
- (void) _finish;
@end @end
@ -179,39 +175,10 @@ static NSMenu *_CurrentMenu = nil;
} }
[super orderFrontRegardless]; [super orderFrontRegardless];
} }
- (void)orderOut:(id)sender
{
[super orderOut:sender];
[_the_menu _finish];
}
- (void)orderWindow:(NSWindowOrderingMode)place relativeTo:(NSInteger)otherWin
{
[super orderWindow:place relativeTo:otherWin];
[_the_menu _finish];
}
@end @end
@implementation NSMenu (GNUstepPrivate) @implementation NSMenu (GNUstepPrivate)
+ (NSMenu*)_currentMenu
{
return _CurrentMenu;
}
+ (void)_setCurrentMenu:(NSMenu*)menu
{
@synchronized(self)
{
if (_CurrentMenu != menu)
{
_CurrentMenu = menu;
}
}
}
- (NSString *) _name; - (NSString *) _name;
{ {
return _name; return _name;
@ -497,11 +464,6 @@ static NSMenu *_CurrentMenu = nil;
[self sizeToFit]; [self sizeToFit];
} }
- (void) _finish
{
[(NSMenuView*)_view _finish];
}
- (void) _setGeometry - (void) _setGeometry
{ {
NSPoint origin; NSPoint origin;

View file

@ -90,10 +90,6 @@ static NSMapTable *viewInfo = 0;
- (void) _attachMenu: (NSMenu*)aMenu; - (void) _attachMenu: (NSMenu*)aMenu;
@end @end
@interface NSMenu (GNUstepPrivate)
+ (void)_setCurrentMenu:(NSMenu*)menu;
@end
@implementation NSMenu (Private) @implementation NSMenu (Private)
- (void) _attachMenu: (NSMenu*)aMenu - (void) _attachMenu: (NSMenu*)aMenu
{ {
@ -1463,8 +1459,6 @@ static NSMapTable *viewInfo = 0;
NSEvent *original; NSEvent *original;
NSEventType type; NSEventType type;
_finished = NO;
/* /*
* The original event is unused except to determine whether the method * The original event is unused except to determine whether the method
* was invoked in response to a right or left mouse down. * was invoked in response to a right or left mouse down.
@ -1737,12 +1731,11 @@ static NSMapTable *viewInfo = 0;
[[event window] sendEvent: event]; [[event window] sendEvent: event];
} }
} }
while (type == NSAppKitDefined && (_finished == NO)); while (type == NSAppKitDefined);
} }
while ((_finished == NO) && while ((type != NSLeftMouseUp &&
((type != NSLeftMouseUp && type != NSRightMouseUp &&
type != NSRightMouseUp && type != NSOtherMouseUp) || shouldFinish == NO);
type != NSOtherMouseUp) || shouldFinish == NO));
/* /*
* Ok, we released the mouse * Ok, we released the mouse
@ -1897,11 +1890,9 @@ static NSMapTable *viewInfo = 0;
originalTopLeft.y += originalFrame.size.height; originalTopLeft.y += originalFrame.size.height;
} }
[NSMenu _setCurrentMenu:[self menu]];
[NSEvent startPeriodicEventsAfterDelay: 0.1 withPeriod: 0.01]; [NSEvent startPeriodicEventsAfterDelay: 0.1 withPeriod: 0.01];
[self trackWithEvent: theEvent]; [self trackWithEvent: theEvent];
[NSEvent stopPeriodicEvents]; [NSEvent stopPeriodicEvents];
[NSMenu _setCurrentMenu:nil];
if (restorePosition) if (restorePosition)
{ {
@ -1988,10 +1979,5 @@ static NSMapTable *viewInfo = 0;
return _itemCells; return _itemCells;
} }
- (void)_finish
{
_finished = YES;
}
@end @end

View file

@ -118,10 +118,6 @@ BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
- (void) postDragEvent: (NSEvent*)event; - (void) postDragEvent: (NSEvent*)event;
@end @end
@interface NSMenu (GNUstepPrivate)
+ (NSMenu*)_currentMenu;
@end
@interface NSView (MoveToWindow) @interface NSView (MoveToWindow)
// Normally this method is only used internally. // Normally this method is only used internally.
- (void) _viewWillMoveToWindow: (NSWindow*)newWindow; - (void) _viewWillMoveToWindow: (NSWindow*)newWindow;
@ -4047,10 +4043,6 @@ resetCursorRectsForView(NSView *theView)
{ {
[self saveFrameUsingName: _autosaveName]; [self saveFrameUsingName: _autosaveName];
} }
if ([NSMenu _currentMenu])
{
[[NSMenu _currentMenu] close];
}
[nc postNotificationName: NSWindowDidMoveNotification [nc postNotificationName: NSWindowDidMoveNotification
object: self]; object: self];
break; break;
@ -4077,10 +4069,6 @@ resetCursorRectsForView(NSView *theView)
{ {
[self saveFrameUsingName: _autosaveName]; [self saveFrameUsingName: _autosaveName];
} }
if ([NSMenu _currentMenu])
{
[[NSMenu _currentMenu] close];
}
[self _processResizeEvent]; [self _processResizeEvent];
[nc postNotificationName: NSWindowDidResizeNotification [nc postNotificationName: NSWindowDidResizeNotification