Minor fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5520 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-12-15 15:28:18 +00:00
parent 2d3a5a1ac6
commit 28b6b4192f
3 changed files with 35 additions and 3 deletions

View file

@ -1,3 +1,10 @@
Wed Dec 15 15:25:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSWindow.m: ([-setFrameAutosaveName:]) bugfix for setting a
nil name (and removing the old name).
* Source/NSMenu.m: ([-close]) close attached menus too.
([-display]) display attached menus too.
Wed Dec 15 11:13:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSResponder.m: Don't try to encode/decode next responder -

View file

@ -1036,6 +1036,12 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
[aWindow orderFront: nil];
menu_isPartlyOffScreen = IS_OFFSCREEN(aWindow);
/*
* If we have just been made visible, we must make sure that any attached
* submenu is visible too.
*/
[[self attachedMenu] display];
}
- (void) displayTransient
@ -1069,6 +1075,18 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
- (void) close
{
NSMenu *sub = [self attachedMenu];
/*
* If we have an attached submenu, we must close that too - but then make
* sure we still have a record of it so that it can be re-displayed if we
* are redisplayed.
*/
if (sub != nil)
{
[sub close];
menu_attachedMenu = sub;
}
[aWindow orderOut: self];
menu_is_visible = NO;

View file

@ -2354,6 +2354,8 @@ resetCursorRectsForView(NSView *theView)
- (BOOL) setFrameAutosaveName: (NSString *)name
{
NSString *nameToRemove = nil;
if ([name isEqual: autosave_name])
{
return YES; /* That's our name already. */
@ -2367,6 +2369,10 @@ resetCursorRectsForView(NSView *theView)
}
if (autosave_name != nil)
{
if (name == nil || [name isEqual: @""] == YES)
{
nameToRemove = RETAIN(autosave_name);
}
[autosaveNames removeObject: autosave_name];
autosave_name = nil;
}
@ -2377,7 +2383,7 @@ resetCursorRectsForView(NSView *theView)
autosave_name = name;
[name release];
}
else
else if (nameToRemove != nil)
{
NSUserDefaults *defs;
NSString *key;
@ -2405,14 +2411,15 @@ resetCursorRectsForView(NSView *theView)
{
dict = AUTORELEASE([dict mutableCopy]);
}
[dict removeObjectForKey: name];
[dict removeObjectForKey: nameToRemove];
[defs setObject: dict forKey: key];
}
else
{
key = [NSString stringWithFormat: @"NSWindow Frame %@", name];
key = [NSString stringWithFormat: @"NSWindow Frame %@", nameToRemove];
[defs removeObjectForKey: key];
}
RELEASE(nameToRemove);
}
[windowsLock unlock];
return YES;