Commit 22475bf3f04c05ec41b7a79b476d4d8a48eca05b

Ryan C. Gordon 2018-09-26T20:10:32

cocoa: Force an OpenGL context update when the window becomes key. Fixes missing rendering on macOS 10.14 ("Mojave"). Fixes Bugzilla #4272. (transplanted from aee4797c84ef90464e270b1f6095a6dd7ce280c1)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index 0cf7ec3..1785ab1 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -632,6 +632,8 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
     const unsigned int newflags = [NSEvent modifierFlags] & NSEventModifierFlagCapsLock;
     _data->videodata->modifierFlags = (_data->videodata->modifierFlags & ~NSEventModifierFlagCapsLock) | newflags;
     SDL_ToggleModState(KMOD_CAPS, newflags != 0);
+
+    ScheduleContextUpdates(_data);
 }
 
 - (void)windowDidResignKey:(NSNotification *)aNotification