Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
More work to clean up compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Dec 5, 2011
1 parent 439625d commit 012fdaa
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/video/cocoa/SDL_cocoamodes.m
Expand Up @@ -27,6 +27,22 @@
/* we need this for ShowMenuBar() and HideMenuBar(). */
#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. */
#define FORCE_OLD_API 0 || (MAC_OS_X_VERSION_MAX_ALLOWED < 1060)

Expand Down Expand Up @@ -384,7 +400,7 @@ - (void) setFrame:(NSRect)frame;
}

if (CGDisplayIsMain(displaydata->display)) {
ShowMenuBar();
Cocoa_ToggleMenuBar(YES);
}
} else {
/* Put up the blanking window (a window above all other windows) */
Expand All @@ -408,7 +424,7 @@ - (void) setFrame:(NSRect)frame;

/* Hide the menu bar so it doesn't intercept events */
if (CGDisplayIsMain(displaydata->display)) {
HideMenuBar();
Cocoa_ToggleMenuBar(NO);
}
}

Expand Down Expand Up @@ -453,7 +469,7 @@ - (void) setFrame:(NSRect)frame;
}

}
ShowMenuBar();
Cocoa_ToggleMenuBar(YES);
}

#endif /* SDL_VIDEO_DRIVER_COCOA */
Expand Down

0 comments on commit 012fdaa

Please sign in to comment.