diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 1a535c088..2d10a9ccb 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -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]; } diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 9370542e1..073f16ef6 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -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"