Revert last doc close and fix releaseWhenClosed.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17691 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2003-09-21 02:27:50 +00:00
parent 1d187a4550
commit 50b7d5288b
4 changed files with 24 additions and 22 deletions

View file

@ -1,3 +1,11 @@
2003-09-20 Adam Fedor <fedor@gnu.org>
* Source/NSWindowController.m ([NSWindowController -setDocument:]):
Set window to releaseWhenClosed if document is not nil.
* Source/NSApplication.m ([NSApplication -targetForAction:]): Revert
last change.
* Source/NSWindow.m ([NSWindow -performClose:]): Idem.
2003-09-19 Matt Rice <ratmice@yahoo.com>
* Source/NSApplication.m ([NSApplication -targetForAction:]): Check

View file

@ -1649,18 +1649,6 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
}
resp = [resp nextResponder];
}
if ([NSDocumentController isDocumentBasedApplication])
{
resp = [[NSDocumentController sharedDocumentController]
documentForWindow: keyWindow];
if (resp != nil && [resp respondsToSelector: aSelector])
{
return resp;
}
}
if ([keyWindow respondsToSelector: aSelector])
{
return keyWindow;
@ -1671,6 +1659,17 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
{
return resp;
}
if ([NSDocumentController isDocumentBasedApplication])
{
resp = [[NSDocumentController sharedDocumentController]
documentForWindow: keyWindow];
if (resp != nil && [resp respondsToSelector: aSelector])
{
return resp;
}
}
}
if (_session != 0)

View file

@ -2304,8 +2304,6 @@ resetCursorRectsForView(NSView *theView)
- (void) performClose: (id)sender
{
NSDocument *document = [_windowController document];
/* Don't close if a modal session is running and we are not the
modal window */
if ([NSApp modalWindow] && self != [NSApp modalWindow])
@ -2320,6 +2318,8 @@ resetCursorRectsForView(NSView *theView)
if (_windowController)
{
NSDocument *document = [_windowController document];
if (document && ![document shouldCloseWindowController: _windowController])
{
NSBeep();
@ -2355,14 +2355,7 @@ resetCursorRectsForView(NSView *theView)
}
// FIXME: The button should be highlighted
if (document)
{
[document close];
}
else
{
[self close];
}
[self close];
}
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent

View file

@ -160,6 +160,8 @@
released. */
[_window setReleasedWhenClosed: NO];
}
else
[_window setReleasedWhenClosed: YES];
}
- (id) document