Cocoa Port: Fix bug where Lion-style full screen failed to work on OS X Mavericks and Yosemite.

This commit is contained in:
rogerman 2017-08-28 19:36:55 -07:00
parent 1e9b179bf4
commit 3bf295f4ce
1 changed files with 8 additions and 9 deletions

View File

@ -1341,10 +1341,16 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
// Set up the scaling factor if this is a Retina window
float scaleFactor = 1.0f;
#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
if ([[self window] respondsToSelector:@selector(backingScaleFactor)])
if ([masterWindow respondsToSelector:@selector(backingScaleFactor)])
{
scaleFactor = [[self window] backingScaleFactor];
scaleFactor = [masterWindow backingScaleFactor];
}
if (_canUseMavericksFullScreen)
{
[masterWindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
else
#endif
// Set up some custom UI elements.
@ -1529,8 +1535,6 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
- (NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions
{
[[NSApplication sharedApplication] setPresentationOptions:NSApplicationPresentationHideDock];
NSApplicationPresentationOptions options = (NSApplicationPresentationHideDock |
NSApplicationPresentationAutoHideMenuBar |
NSApplicationPresentationFullScreen |
@ -1563,11 +1567,6 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
_screenMap.erase([self assignedScreen]);
[self setAssignedScreen:nil];
[self setIsShowingStatusBar:_masterStatusBarState];
if (_screenMap.size() == 0)
{
[[NSApplication sharedApplication] setPresentationOptions:NSApplicationPresentationDefault];
}
}
#endif