mac: Wait a bit before activating app at startup.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 12 Feb 2020 13:08:29 -0500
changeset 13512d85e27d937eb
parent 13511 1bc601a25155
child 13513 af27f52d379a
mac: Wait a bit before activating app at startup.

This is obnoxious and wrong, but the patch that activates the Dock before
activating the app fixes the _menu_ not responding on Catalina, but the
first window created by the app won't have keyboard focus without a small
delay inserted.

This obviously needs a better solution, but it gets it limping along correctly
for now.
src/video/cocoa/SDL_cocoaevents.m
     1.1 --- a/src/video/cocoa/SDL_cocoaevents.m	Tue Feb 11 21:19:05 2020 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoaevents.m	Wed Feb 12 13:08:29 2020 -0500
     1.3 @@ -244,6 +244,7 @@
     1.4              [i activateWithOptions:NSApplicationActivateIgnoringOtherApps];
     1.5              break;
     1.6          }
     1.7 +        SDL_Delay(300);  /* !!! FIXME: this isn't right. */
     1.8          [NSApp activateIgnoringOtherApps:YES];
     1.9      }
    1.10