From 094655cff99949b8a511339636f88ebfac7142ac Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 23 Feb 2020 14:49:03 -0500 Subject: [PATCH] cocoa: Make sure wait for button enable can't be infinite. --- src/video/cocoa/SDL_cocoawindow.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 15dd14cda..79e1b9de0 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -876,7 +876,7 @@ SetWindowStyle(SDL_Window * window, NSUInteger style) button = [nswindow standardWindowButton:NSWindowMiniaturizeButton]; if (button) { int iterations = 0; - while (![button isEnabled]) { + while (![button isEnabled] && (iterations < 100)) { SDL_Delay(10); SDL_PumpEvents(); iterations++;