Commit 6f62ce7b authored by Ryan C. Gordon's avatar Ryan C. Gordon

More work to clean up compiler warnings.

parent f98e2268
...@@ -27,6 +27,22 @@ ...@@ -27,6 +27,22 @@
/* we need this for ShowMenuBar() and HideMenuBar(). */ /* we need this for ShowMenuBar() and HideMenuBar(). */
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
static inline void Cocoa_ToggleMenuBar(const BOOL show)
{
/* !!! FIXME: keep an eye on this.
* ShowMenuBar/HideMenuBar is officially unavailable for 64-bit binaries.
* It happens to work, as of 10.7, but we're going to see if
* we can just simply do without it on newer OSes...
*/
#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070) && !defined(__LP64__)
if (show)
ShowMenuBar();
else
HideMenuBar();
#endif
}
/* !!! FIXME: clean out the pre-10.6 code when it makes sense to do so. */ /* !!! FIXME: clean out the pre-10.6 code when it makes sense to do so. */
#define FORCE_OLD_API 0 || (MAC_OS_X_VERSION_MAX_ALLOWED < 1060) #define FORCE_OLD_API 0 || (MAC_OS_X_VERSION_MAX_ALLOWED < 1060)
...@@ -384,7 +400,7 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) ...@@ -384,7 +400,7 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
} }
if (CGDisplayIsMain(displaydata->display)) { if (CGDisplayIsMain(displaydata->display)) {
ShowMenuBar(); Cocoa_ToggleMenuBar(YES);
} }
} else { } else {
/* Put up the blanking window (a window above all other windows) */ /* Put up the blanking window (a window above all other windows) */
...@@ -408,7 +424,7 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) ...@@ -408,7 +424,7 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
/* Hide the menu bar so it doesn't intercept events */ /* Hide the menu bar so it doesn't intercept events */
if (CGDisplayIsMain(displaydata->display)) { if (CGDisplayIsMain(displaydata->display)) {
HideMenuBar(); Cocoa_ToggleMenuBar(NO);
} }
} }
...@@ -453,7 +469,7 @@ Cocoa_QuitModes(_THIS) ...@@ -453,7 +469,7 @@ Cocoa_QuitModes(_THIS)
} }
} }
ShowMenuBar(); Cocoa_ToggleMenuBar(YES);
} }
#endif /* SDL_VIDEO_DRIVER_COCOA */ #endif /* SDL_VIDEO_DRIVER_COCOA */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment