Use native Lion full screen functionality

On Lion use the full screen functionality built into the OS.  Also
change the shortcut to toggle full screen to Cmd-Ctrl-f.
This commit is contained in:
Bjorn Winckler
2011-07-10 13:59:44 +02:00
parent 301fd4c3ac
commit 47e83bcd2e
4 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -1215,7 +1215,7 @@ if has("gui_macvim")
macm Window.Minimize\ All key=<D-M-m> action=miniaturizeAll: alt=YES
macm Window.Zoom key=<D-C-z> action=performZoom:
macm Window.Zoom\ All key=<D-M-C-z> action=zoomAll: alt=YES
macm Window.Toggle\ Full\ Screen\ Mode key=<D-F>
macm Window.Toggle\ Full\ Screen\ Mode key=<D-C-f>
macm Window.Select\ Next\ Tab key=<D-}>
macm Window.Select\ Previous\ Tab key=<D-{>
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
+8
View File
@@ -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
+12
View File
@@ -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 -------------------------------------------------
+3
View File
@@ -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
//