Merge pull request #523 from alexey-lysiuk/osx_fullscreen

Final touches to fullscreen mode on OS X
This commit is contained in:
coelckers 2016-01-31 16:56:35 +01:00
commit c3cc98b5f3
2 changed files with 26 additions and 0 deletions

View file

@ -70,6 +70,27 @@
@end
@interface NSWindow(EnterFullscreenOnZoom)
- (void)enterFullscreenOnZoom;
@end
@implementation NSWindow(EnterFullscreenOnZoom)
- (void)enterFullscreen:(id)sender
{
ToggleFullscreen = true;
}
- (void)enterFullscreenOnZoom
{
NSButton* zoomButton = [self standardWindowButton:NSWindowZoomButton];
[zoomButton setEnabled:YES];
[zoomButton setAction:@selector(enterFullscreen:)];
[zoomButton setTarget:self];
}
@end
EXTERN_CVAR(Bool, ticker )
EXTERN_CVAR(Bool, vid_vsync)
@ -676,6 +697,7 @@ void CocoaVideo::SetWindowedMode(const int width, const int height)
[m_window setContentSize:windowSize];
[m_window center];
[m_window enterFullscreenOnZoom];
[m_window exitAppOnClose];
}

View file

@ -884,6 +884,10 @@ OptionMenu "MiscOptions"
Option "Merge left+right Alt/Ctrl/Shift", "k_mergekeys", "OnOff"
Option "Alt-Enter toggles fullscreen", "k_allowfullscreentoggle", "OnOff"
}
IfOption(Mac)
{
Option "Command-F toggles fullscreen", "k_allowfullscreentoggle", "OnOff"
}
Option "Show IWAD selection dialog", "queryiwad", "OnOff"
StaticText " "
Option "Enable cheats from all games", "allcheats", "OnOff"