Fixed exiting when window is closed by clicking close button

This happened on 10.6 and later when fullscreen mode was used before windowed
This commit is contained in:
alexey.lysiuk 2014-11-15 11:47:05 +02:00
parent 9e4a262c87
commit 4b5d7361cd
1 changed files with 6 additions and 12 deletions

View File

@ -1163,6 +1163,8 @@ static bool s_fullscreenNewAPI;
// Hide window as nothing will be rendered at this point
[m_window orderOut:nil];
I_ShutdownJoysticks();
}
@ -1187,10 +1189,6 @@ static bool s_fullscreenNewAPI;
[window makeFirstResponder:self];
[window setAcceptsMouseMovedEvents:YES];
NSButton* closeButton = [window standardWindowButton:NSWindowCloseButton];
[closeButton setAction:@selector(closeWindow:)];
[closeButton setTarget:self];
return window;
}
@ -1297,6 +1295,10 @@ static bool s_fullscreenNewAPI;
[m_window setContentSize:windowSize];
[m_window center];
NSButton* closeButton = [m_window standardWindowButton:NSWindowCloseButton];
[closeButton setAction:@selector(terminate:)];
[closeButton setTarget:NSApp];
}
- (void)changeVideoResolution:(bool)fullscreen width:(int)width height:(int)height useHiDPI:(bool)hiDPI
@ -1496,14 +1498,6 @@ static bool s_fullscreenNewAPI;
m_window = tempWindow;
}
- (void)closeWindow:(id)sender
{
I_ShutdownJoysticks();
[NSApp terminate:sender];
}
@end