@@ -, +, @@ 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. --- a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m +++ a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m @@ -14,6 +14,8 @@ #endif */ +#include + #import "MacOSXWindowSystemInterface.h" #import "ContextUpdater.h" @@ -556,7 +558,9 @@ NSOpenGLContext* createContext(NSOpenGLContext* share, GLint zeroOpacity = 0; [ctx setValues:&zeroOpacity forParameter:NSOpenGLCPSurfaceOpacity]; } - [ctx setView:view]; // Bug 1087: Set default framebuffer, hence enforce NSView realization + dispatch_async(dispatch_get_main_queue(), ^{ // Fix for MacOS Catalina: -[NSOpenGLContext setView:] must be called from the main thread. + [ctx setView:view]; // Bug 1087: Set default framebuffer, hence enforce NSView realization + }); if( viewReadyAndLocked ) { [view unlockFocus]; } @@ -574,7 +578,9 @@ 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]; + dispatch_async(dispatch_get_main_queue(), ^{ + [ctx setView:view]; + }); [view unlockFocus]; } } @@ -655,7 +661,9 @@ 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]; + dispatch_async(dispatch_get_main_queue(), ^{ + [ctx update]; + }); DBG_PRINT("updateContext.X\n"); } [pool release];