diff --git a/runtime/menu.vim b/runtime/menu.vim index 626b43a104..1dcb349f4b 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -1215,7 +1215,7 @@ if has("gui_macvim") macm Window.Minimize\ All key= action=miniaturizeAll: alt=YES macm Window.Zoom key= action=performZoom: macm Window.Zoom\ All key= action=zoomAll: alt=YES - macm Window.Toggle\ Full\ Screen\ Mode key= + macm Window.Toggle\ Full\ Screen\ Mode key= macm Window.Select\ Next\ Tab key= macm Window.Select\ Previous\ Tab key= macm Window.Bring\ All\ To\ Front action=arrangeInFront: diff --git a/src/MacVim/MMVimController.m b/src/MacVim/MMVimController.m index 99bad6a756..3db777d02d 100644 --- a/src/MacVim/MMVimController.m +++ b/src/MacVim/MMVimController.m @@ -766,14 +766,22 @@ static BOOL isUnsafeMessage(int msgid); [self setServerName:name]; [name release]; } else if (EnterFullscreenMsgID == msgid) { +#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7) const void *bytes = [data bytes]; int fuoptions = *((int*)bytes); bytes += sizeof(int); int bg = *((int*)bytes); NSColor *back = [NSColor colorWithArgbInt:bg]; [windowController enterFullscreen:fuoptions backgroundColor:back]; +#else + [[windowController window] toggleFullScreen:self]; +#endif } else if (LeaveFullscreenMsgID == msgid) { +#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7) [windowController leaveFullscreen]; +#else + [[windowController window] toggleFullScreen:self]; +#endif } else if (SetBuffersModifiedMsgID == msgid) { const void *bytes = [data bytes]; // state < 0 <-> some buffer modified diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 6f4a7dc0b2..68b50aa420 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -181,6 +181,10 @@ if ([win respondsToSelector:@selector(_setContentHasShadow:)]) [win _setContentHasShadow:NO]; +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) + [win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; +#endif + return self; } @@ -957,6 +961,14 @@ [vimController sendMessage:ZoomMsgID data:data]; } +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) +- (NSApplicationPresentationOptions)window:(NSWindow *)window + willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)opt +{ + return opt | NSApplicationPresentationAutoHideToolbar; +} +#endif + // -- Services menu delegate ------------------------------------------------- diff --git a/src/MacVim/MacVim.h b/src/MacVim/MacVim.h index ca37c2d89c..2061dc0f0c 100644 --- a/src/MacVim/MacVim.h +++ b/src/MacVim/MacVim.h @@ -22,6 +22,9 @@ #ifndef MAC_OS_X_VERSION_10_6 # define MAC_OS_X_VERSION_10_6 1060 #endif +#ifndef MAC_OS_X_VERSION_10_7 +# define MAC_OS_X_VERSION_10_7 1070 +#endif //