Enabled zoom window button on OS X

Independently from OS version the game will enter fullscreen mode when zoom button is clicked
Window zooming behavior introduced in Yosemite is available on all supported versions of OS X
This commit is contained in:
alexey.lysiuk 2016-01-31 10:42:16 +02:00
parent bb00c9b588
commit 7b0f557514

View file

@ -70,6 +70,27 @@
@end @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, ticker )
EXTERN_CVAR(Bool, vid_vsync) EXTERN_CVAR(Bool, vid_vsync)
@ -676,6 +697,7 @@ void CocoaVideo::SetWindowedMode(const int width, const int height)
[m_window setContentSize:windowSize]; [m_window setContentSize:windowSize];
[m_window center]; [m_window center];
[m_window enterFullscreenOnZoom];
[m_window exitAppOnClose]; [m_window exitAppOnClose];
} }