mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
OSX, fixed sf::Window::SetPosition for 10.4 and 10.5 (theoretically)
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1774 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
0cf57db9c2
commit
8d9de8396b
@ -423,8 +423,21 @@
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
-(float)screenHeight {
|
||||
NSLog(@"hihi");
|
||||
// With Mac OS X 10.4 and 10.5, there is a shift upwards
|
||||
// (about 22px – that is the apple menu bar height). With 10.6 and later
|
||||
// we have a workaround : we hide the dock and get the visibleFrame of the
|
||||
// screen (see NSApplicationPresentationOptions and NSScreen for more info).
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
|
||||
NSLog(@"<1060");
|
||||
return NSHeight([[myWindow screen] frame]);
|
||||
|
||||
#else // (NSApplicationPresentationOptions Availability: Mac OS X 10.6 and later)
|
||||
// We want to recompute it because the user may have moved the window to another screen
|
||||
// since last time.
|
||||
|
||||
NSLog(@">=1060");
|
||||
|
||||
static float height = 0.f;
|
||||
static NSDate* lastTime = [NSDate date];
|
||||
if (height > 1.f && // height was set at least once.
|
||||
@ -446,6 +459,7 @@
|
||||
[NSApp setPresentationOptions:currentOptions];
|
||||
|
||||
return height;
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user