mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 00:20:51 +00:00
Document close fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17688 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
50ed66958a
commit
1d187a4550
3 changed files with 29 additions and 14 deletions
|
@ -2304,6 +2304,8 @@ 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])
|
||||
|
@ -2318,8 +2320,6 @@ resetCursorRectsForView(NSView *theView)
|
|||
|
||||
if (_windowController)
|
||||
{
|
||||
NSDocument *document = [_windowController document];
|
||||
|
||||
if (document && ![document shouldCloseWindowController: _windowController])
|
||||
{
|
||||
NSBeep();
|
||||
|
@ -2355,7 +2355,14 @@ resetCursorRectsForView(NSView *theView)
|
|||
}
|
||||
|
||||
// FIXME: The button should be highlighted
|
||||
[self close];
|
||||
if (document)
|
||||
{
|
||||
[document close];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self close];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue