diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index 803b4ecd2..5c44e31e0 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -110,11 +110,19 @@ if ([self view] != [windowdata->nswindow contentView]) { [self setView:[windowdata->nswindow contentView]]; - [self scheduleUpdate]; + if (self == [NSOpenGLContext currentContext]) { + [self update]; + } else { + [self scheduleUpdate]; + } } } else { [self clearDrawable]; - [self scheduleUpdate]; + if (self == [NSOpenGLContext currentContext]) { + [self update]; + } else { + [self scheduleUpdate]; + } } } diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 03ece7b9e..a773cb684 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -49,10 +49,15 @@ static void ConvertNSRect(NSRect *r) static void ScheduleContextUpdates(SDL_WindowData *data) { + NSOpenGLContext *currentContext = [NSOpenGLContext currentContext]; NSMutableArray *contexts = data->nscontexts; @synchronized (contexts) { for (SDLOpenGLContext *context in contexts) { - [context scheduleUpdate]; + if (context == currentContext) { + [context update]; + } else { + [context scheduleUpdate]; + } } } }