Updated the fix to work on both naked and wrapped (.app) macos executables

This commit is contained in:
Scott Bennett 2018-10-04 10:59:27 -05:00
parent 11d637558e
commit 5b3a2cb4b4

View File

@ -266,8 +266,17 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
{
self = [super init];
if (self != nil)
{
window = initWindow;
// HACK: Force an update shortly after the window appears to avoid the
// issue where macOS mojave does not start rendering to the OpenGL view
dispatch_async(dispatch_get_main_queue(), ^() {
if (window->context.client != GLFW_NO_API)
[window->context.nsgl.object update];
});
}
return self;
}
@ -343,10 +352,6 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
- (void)windowDidBecomeKey:(NSNotification *)notification
{
// Fix for macOS mojave not rendering the OpenGL view on window start
if (window->context.client != GLFW_NO_API)
[window->context.nsgl.object update];
if (_glfw.ns.disabledCursorWindow == window)
centerCursor(window);