Merge branch 'macosstuckwindowfix' of github.com:treamology/panda3d into release/1.10.x

Closes #536
Fixes #534
This commit is contained in:
rdb 2019-03-04 12:23:15 +01:00
commit 4e92b708ff
3 changed files with 9 additions and 7 deletions

View File

@ -711,8 +711,11 @@ close_window() {
}
if (_window != nil) {
[_window setReleasedWhenClosed: YES];
[_window close];
// Process events once more so any pending NSEvents are cleared. Not doing
// this causes the window to stick around after calling [_window close].
process_events();
_window = nil;
}

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