cocoa: Force an OpenGL context update when the window becomes key. SDL-ryan-batching-renderer
authorRyan C. Gordon <icculus@icculus.org>
Wed, 26 Sep 2018 20:10:32 -0400
branchSDL-ryan-batching-renderer
changeset 122614e77fde5bbc7
parent 12238 25ae936ee1e3
child 12262 2a34f0026a8d
cocoa: Force an OpenGL context update when the window becomes key.

Fixes missing rendering on macOS 10.14 ("Mojave").

Fixes Bugzilla #4272.
(transplanted from 55489adbb75c8eb7c7719a3f9c85a15d06df2f27)
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Tue Sep 25 21:35:09 2018 -0400
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Wed Sep 26 20:10:32 2018 -0400
     1.3 @@ -632,6 +632,8 @@
     1.4      const unsigned int newflags = [NSEvent modifierFlags] & NSEventModifierFlagCapsLock;
     1.5      _data->videodata->modifierFlags = (_data->videodata->modifierFlags & ~NSEventModifierFlagCapsLock) | newflags;
     1.6      SDL_ToggleModState(KMOD_CAPS, newflags != 0);
     1.7 +
     1.8 +    ScheduleContextUpdates(_data);
     1.9  }
    1.10  
    1.11  - (void)windowDidResignKey:(NSNotification *)aNotification