Issue with SDL_MinimizeWindow on macOS

I’ve been running into an issue with the SDL_MinimizeWindow() on macOS 10.13 High Sierra. When I have a fullscreen window open and call SDL_MinimizeWindow() on High Sierra, the window remains visible but goes behind the menu bar and dock. Non-fullscreen windows are unaffected. This issue does not occur on macOS 10.12 Sierra, and in fact it doesn’t occur on High Sierra either if you compile it on an earlier OS (I tried Yosemite with Xcode 7.2.1) and then bring it over to High Sierra to run it.

Here’s a video demonstrating the issue with a test application I wrote, and then with the game I help maintain where I first heard a report of this issue: https://youtu.be/RO1WeW-St3E

Here’s the test code I used to demonstrate the issue: minimizetest.cpp (1.4 KB)

I experienced this issue with every version of SDL 2 from 2.0.3 to 2.0.8, and even in the latest code in mercurial. I only tested it on Xcode 7 (where the issue doesn’t appear) and Xcode 9 (where the issue appears). I’m not sure exactly which macOS SDK version introduced the problem.

Any ideas?

No response here, so I went ahead and filed a bug report on bugzilla.

https://bugzilla.libsdl.org/show_bug.cgi?id=4177

Has anyone else run into this issue at all, or have an idea of what might be the cause? For me, SDL_MinimizeWindow() is completely broken on the last few versions of Xcode on macOS, so I was surprised to see no other discussion on this bug since I reported it.

I am happy to help where I can, but I’m sure there are people here who have the knowledge to pinpoint where the problem lies.

Since there is another major macOS bug being fixed soon, it would be great if this issue could be addressed as well before the next version of SDL is released. It would be great to be able to move forward from Xcode 7, which is where we are currently stuck.

I know I’m talking to myself here, but can anyone please help take a look at this? I looked at the code to see if I could help come up with a fix, but it seems to be just a call to [NSWindow miniaturize], so I’m not sure what is required to fix it.

It would be great if this issue could be addressed before the next stable release.