mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
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:
+1
-1
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 -------------------------------------------------
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user