OSX: associate abr file, fix shell open file when process is running, fix shutdown

This commit is contained in:
2019-03-01 20:27:42 +01:00
parent 05c46b4744
commit a14afe5b44
3 changed files with 148 additions and 26 deletions

View File

@@ -169,8 +169,9 @@ std::mutex task_mutex;
- (void)terminateGL
{
CGLLockContext([[self openGLContext] CGLContextObj]);
CVDisplayLinkRelease(dl);
App::I.terminate();
CGLUnlockContext([[self openGLContext] CGLContextObj]);
CVDisplayLinkRelease(dl);
}
// This is the renderer output callback function
@@ -445,7 +446,6 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
@implementation Controller
- (void)windowWillClose:(NSNotification *)notification
{
App::I.terminate();
[[NSApplication sharedApplication] terminate:nil];
}
-(BOOL)windowShouldClose:(NSWindow *)sender
@@ -472,7 +472,8 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
{
LOG("open file %s", [filename UTF8String]);
//App::I.open_document([filename UTF8String]);
if (view && view->gl_ready)
App::I.open_document([filename UTF8String]);
file2open = filename;
return YES;
}