|
@@ -235,6 +235,14 @@ void Cocoa_VideoQuit(SDL_VideoDevice *_this)
|
|
|
{
|
|
{
|
|
|
@autoreleasepool {
|
|
@autoreleasepool {
|
|
|
SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal;
|
|
SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal;
|
|
|
|
|
+
|
|
|
|
|
+ // Run the CFRunLoop a little, so last-minute window animations can run, etc, but we hopefully don't change any significant state.
|
|
|
|
|
+ // This needs to run multiple times over a time period, it's not enough to give it a longer timeout and use "false" for returnAfterSourceHandled.
|
|
|
|
|
+ const Uint64 start = SDL_GetTicks();
|
|
|
|
|
+ do {
|
|
|
|
|
+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, false);
|
|
|
|
|
+ } while ((SDL_GetTicks() - start) <= 20);
|
|
|
|
|
+
|
|
|
Cocoa_QuitModes(_this);
|
|
Cocoa_QuitModes(_this);
|
|
|
Cocoa_QuitKeyboard(_this);
|
|
Cocoa_QuitKeyboard(_this);
|
|
|
Cocoa_QuitGCMouse();
|
|
Cocoa_QuitGCMouse();
|