commit 5380377443527329db106b5904509c393bf60ec4 Author: Jani Turkia Date: Tue Nov 19 15:06:58 2019 -0600 Moved manipulations of NSOpenGLContext and the NSView related to it to the main thread. In at least MacOS Catalina (10.15) the OpenGL context must be created and updated on the main thread only. This is from the crash report: -[NSOpenGLContext setView:] must be called from the main thread. diff --git a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m index 462b539..43ed8e1 100644 --- a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m +++ b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m @@ -556,7 +556,7 @@ NSOpenGLContext* createContext(NSOpenGLContext* share, GLint zeroOpacity = 0; [ctx setValues:&zeroOpacity forParameter:NSOpenGLCPSurfaceOpacity]; } - [ctx setView:view]; // Bug 1087: Set default framebuffer, hence enforce NSView realization + [ctx performSelectorOnMainThread:@selector(setView) withObject:view waitUntilDone:YES]; // Bug 1087: Set default framebuffer, hence enforce NSView realization if( viewReadyAndLocked ) { [view unlockFocus]; } @@ -574,7 +574,7 @@ void setContextView(NSOpenGLContext* ctx, NSView* view) { Bool viewReadyAndLocked = lockViewIfReady(view); DBG_PRINT("setContextView.0: ctx %p, view %p: setView: %d\n", ctx, view, viewReadyAndLocked); if( viewReadyAndLocked ) { - [ctx setView:view]; + [ctx performSelectorOnMainThread:@selector(setView) withObject:view waitUntilDone:YES]; [view unlockFocus]; } } @@ -655,7 +655,7 @@ void updateContext(NSOpenGLContext* ctx) { NSView *nsView = [ctx view]; if(NULL != nsView) { DBG_PRINT("updateContext.0: ctx %p, ctx.view %p\n", ctx, nsView); - [ctx update]; + [ctx performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:YES]; DBG_PRINT("updateContext.X\n"); } [pool release];