Move handle_close_event() call to windowShouldClose, which only triggers when the close button is pressed by the user.

This commit is contained in:
Donny Lawrence 2019-01-13 19:07:43 -05:00
parent d51db6e39e
commit 2c513ba1c4
2 changed files with 5 additions and 6 deletions

View File

@ -34,7 +34,6 @@ class CocoaGraphicsWindow;
- (void)windowDidBecomeKey:(NSNotification *)notification;
- (void)windowDidResignKey:(NSNotification *)notification;
- (BOOL)windowShouldClose:(id)sender;
- (void)windowWillClose:(NSNotification *)notification;
// TODO: handle fullscreen on Lion.

View File

@ -50,11 +50,11 @@
}
- (BOOL) windowShouldClose:(id)sender {
return _graphicsWindow->handle_close_request();
}
- (void) windowWillClose:(NSNotification *)notification {
_graphicsWindow->handle_close_event();
bool should_close = _graphicsWindow->handle_close_request();
if (should_close) {
_graphicsWindow->handle_close_event();
}
return should_close;
}
@end