cocoa: Make sure wait for button enable can't be infinite.

This commit is contained in:
Ryan C. Gordon 2020-02-23 14:49:03 -05:00
parent 723165187f
commit 094655cff9

View File

@ -876,7 +876,7 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
button = [nswindow standardWindowButton:NSWindowMiniaturizeButton]; button = [nswindow standardWindowButton:NSWindowMiniaturizeButton];
if (button) { if (button) {
int iterations = 0; int iterations = 0;
while (![button isEnabled]) { while (![button isEnabled] && (iterations < 100)) {
SDL_Delay(10); SDL_Delay(10);
SDL_PumpEvents(); SDL_PumpEvents();
iterations++; iterations++;