mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| af13572c16 | |||
| 62511ccb37 | |||
| 9007fe7ea4 | |||
| 1435c84507 | |||
| 8d255ed95a | |||
| 84bd7acdcb | |||
| 871d6fb68d | |||
| 8b7a78a4ca | |||
| 98346d00d1 | |||
| 7f8ed177e5 | |||
| d01ee9a02b | |||
| 4fbdea5683 | |||
| bcfd3686d3 | |||
| 705cce16cb | |||
| ec80934916 | |||
| 9dabefa342 | |||
| 19d9e88653 | |||
| f295c0db32 | |||
| b8e2540fef | |||
| 6f05829f7e | |||
| 9e6a7b76b5 | |||
| df741b5f4e | |||
| 79ba4bcdc0 | |||
| 6bd19ecf62 | |||
| df0c4d770c | |||
| 672bf1f0fc | |||
| 1c1b721b93 | |||
| 37741a0cb5 | |||
| 88b7b921be | |||
| 35c355a085 | |||
| 47e83bcd2e |
@@ -3,6 +3,8 @@
|
||||
src/MacVim/MacVim.xcodeproj/*.mode1
|
||||
src/MacVim/MacVim.xcodeproj/*.mode1v3
|
||||
src/MacVim/MacVim.xcodeproj/*.pbxuser
|
||||
src/MacVim/MacVim.xcodeproj/project.xcworkspace
|
||||
src/MacVim/MacVim.xcodeproj/xcuserdata
|
||||
src/MacVim/icons/*.pyc
|
||||
src/MacVim/icons/*.ttf
|
||||
src/MacVim/icons/*.reg
|
||||
@@ -16,6 +18,7 @@ src/MacVim/icons/makeicns/makeicns
|
||||
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1
|
||||
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1v3
|
||||
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.pbxuser
|
||||
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/xcuserdata
|
||||
src/MacVim/PSMTabBarControl/build
|
||||
src/MacVim/PSMTabBarControl/build
|
||||
src/MacVim/build
|
||||
@@ -35,3 +38,4 @@ src/po/*.mo
|
||||
src/tags
|
||||
src/xxd/xxd
|
||||
src/xxd/xxd.dSYM
|
||||
src/a.out.dSYM
|
||||
|
||||
+11
-4
@@ -1,4 +1,4 @@
|
||||
*gui_mac.txt* For Vim version 7.3. Last change: 2010 Dec 28
|
||||
*gui_mac.txt* For Vim version 7.3. Last change: 2011 Jul 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bjorn Winckler
|
||||
@@ -594,10 +594,17 @@ Alt-Up Move cursor one paragraph forward (see |alt-movement|).
|
||||
Alt-Down Move cursor to the previous paragraph
|
||||
(see |alt-movement|).
|
||||
|
||||
*delete-key* *macvim-<Backspace>*
|
||||
Delete key Delete selection in visual mode. (This overrides the
|
||||
default behavior of moving the cursor left.)
|
||||
Note that the key labeled "delete" on a Mac keyboard
|
||||
is known to Vim as <Backspace>.
|
||||
|
||||
*cmd-movement* *alt-movement*
|
||||
The above mappings involving Cmd/Alt + arrow key are enabled by default in the
|
||||
system gvimrc file "$VIM/gvimrc". You can quickly disable all of these by
|
||||
adding the following lines to your "~/.vimrc" (not .gvimrc) file: >
|
||||
The above mappings involving Cmd/Alt + arrow key (including the delete key)
|
||||
are enabled by default in the system gvimrc file "$VIM/gvimrc". You can
|
||||
disable all of these by adding the following lines to your "~/.vimrc" (not
|
||||
.gvimrc) file: >
|
||||
if has("gui_macvim")
|
||||
let macvim_skip_cmd_opt_movement = 1
|
||||
endif
|
||||
|
||||
@@ -3308,7 +3308,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
XXX: Think about how 'fullscreen' and 'transparency' should interact.
|
||||
|
||||
*'fuoptions'* *'fuopt'*
|
||||
'fuoptions' 'fuopt' string (default "maxvert")
|
||||
'fuoptions' 'fuopt' string (default "maxvert,maxhorz")
|
||||
global
|
||||
{not in Vi}
|
||||
{only in MacVim GUI}
|
||||
@@ -3328,6 +3328,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
number of columns, it is restored to the value it had before
|
||||
entering fullscreen.
|
||||
background:color
|
||||
{not supported in Mac OS X native full screen}
|
||||
When entering fullscreen, 'color' defines the color of the part
|
||||
of the screen that is not occupied by the Vim control. If
|
||||
'color' is an 8-digit hexadecimal number preceded by '#',
|
||||
@@ -3339,15 +3340,15 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
scheme.
|
||||
|
||||
Examples:
|
||||
Don't change size of Vim when entering fullscreen: >
|
||||
Don't change size when entering fullscreen: >
|
||||
:set fuoptions=
|
||||
< Maximize Vim when entering fullscreen: >
|
||||
:set fuoptions=maxvert,maxhorz
|
||||
< Maximize Vim only vertically when entering fullscreen, and color the
|
||||
< Only maximize vertically when entering fullscreen: >
|
||||
:set fuoptions=maxvert
|
||||
< Maximize only vertically when entering fullscreen, and color the
|
||||
background dark blue: >
|
||||
:set fuoptions=maxvert,background:#FF003042
|
||||
< Don't change the size of Vim when entering fullscreen, and color the
|
||||
background like the current text background: >
|
||||
< Don't change size when entering fullscreen, and color the background
|
||||
like the current text background: >
|
||||
:set fuoptions=background:Normal
|
||||
<
|
||||
XXX: what if the font size is changed? you probably never want to
|
||||
|
||||
@@ -5293,6 +5293,7 @@ definition-search tagsrch.txt /*definition-search*
|
||||
definitions intro.txt /*definitions*
|
||||
delete() eval.txt /*delete()*
|
||||
delete-insert change.txt /*delete-insert*
|
||||
delete-key gui_mac.txt /*delete-key*
|
||||
delete-menus gui.txt /*delete-menus*
|
||||
deleting change.txt /*deleting*
|
||||
design-assumptions develop.txt /*design-assumptions*
|
||||
@@ -6609,6 +6610,7 @@ mac-vimfile os_mac.txt /*mac-vimfile*
|
||||
macintosh os_mac.txt /*macintosh*
|
||||
macro map.txt /*macro*
|
||||
macvim gui_mac.txt /*macvim*
|
||||
macvim-<Backspace> gui_mac.txt /*macvim-<Backspace>*
|
||||
macvim-backspace gui_mac.txt /*macvim-backspace*
|
||||
macvim-clientserver remote.txt /*macvim-clientserver*
|
||||
macvim-colors gui_mac.txt /*macvim-colors*
|
||||
|
||||
+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:
|
||||
|
||||
@@ -1232,7 +1232,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>60</string>
|
||||
<string>61</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -223,6 +223,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
[NSNumber numberWithBool:YES], MMUseInlineImKey,
|
||||
#endif // INCLUDE_OLD_IM_CODE
|
||||
[NSNumber numberWithBool:NO], MMSuppressTerminationAlertKey,
|
||||
[NSNumber numberWithBool:YES], MMNativeFullScreenKey,
|
||||
nil];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
|
||||
@@ -241,6 +242,12 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
{
|
||||
if (!(self = [super init])) return nil;
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||
// Disable automatic relaunching
|
||||
if ([NSApp respondsToSelector:@selector(disableRelaunchOnLogin)])
|
||||
[NSApp disableRelaunchOnLogin];
|
||||
#endif
|
||||
|
||||
vimControllers = [NSMutableArray new];
|
||||
cachedVimControllers = [NSMutableArray new];
|
||||
preloadPid = -1;
|
||||
@@ -1065,10 +1072,40 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
[panel setAllowsMultipleSelection:YES];
|
||||
[panel setAccessoryView:showHiddenFilesView()];
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
|
||||
// NOTE: -[NSOpenPanel runModalForDirectory:file:types:] is deprecated on
|
||||
// 10.7 but -[NSOpenPanel setDirectoryURL:] requires 10.6 so jump through
|
||||
// the following hoops on 10.6+.
|
||||
dir = [dir stringByExpandingTildeInPath];
|
||||
if (dir) {
|
||||
NSURL *dirURL = [NSURL fileURLWithPath:dir isDirectory:YES];
|
||||
if (dirURL)
|
||||
[panel setDirectoryURL:dirURL];
|
||||
}
|
||||
|
||||
int result = [panel runModalForDirectory:dir file:nil types:nil];
|
||||
if (NSOKButton == result)
|
||||
[self application:NSApp openFiles:[panel filenames]];
|
||||
NSInteger result = [panel runModal];
|
||||
#else
|
||||
NSInteger result = [panel runModalForDirectory:dir file:nil types:nil];
|
||||
#endif
|
||||
if (NSOKButton == result) {
|
||||
// NOTE: -[NSOpenPanel filenames] is deprecated on 10.7 so use
|
||||
// -[NSOpenPanel URLs] instead. The downside is that we have to check
|
||||
// that each URL is really a path first.
|
||||
NSMutableArray *filenames = [NSMutableArray array];
|
||||
NSArray *urls = [panel URLs];
|
||||
NSUInteger i, count = [urls count];
|
||||
for (i = 0; i < count; ++i) {
|
||||
NSURL *url = [urls objectAtIndex:i];
|
||||
if ([url isFileURL]) {
|
||||
NSString *path = [url path];
|
||||
if (path)
|
||||
[filenames addObject:path];
|
||||
}
|
||||
}
|
||||
|
||||
if ([filenames count] > 0)
|
||||
[self application:NSApp openFiles:filenames];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)selectNextWindow:(id)sender
|
||||
@@ -1410,7 +1447,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
// as follows:
|
||||
//
|
||||
// 1. Search through ordered windows as determined by NSApp. Unfortunately
|
||||
// this method can fail, e.g. if a full screen window is on another
|
||||
// this method can fail, e.g. if a full-screen window is on another
|
||||
// "Space" (in this case NSApp returns no windows at all), so we have to
|
||||
// fall back on ...
|
||||
// 2. Search through all Vim controllers and return the first visible
|
||||
|
||||
@@ -131,9 +131,9 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
|
||||
- (int)lookupColorWithKey:(NSString *)key;
|
||||
- (BOOL)hasSpecialKeyWithValue:(char_u *)value;
|
||||
|
||||
- (void)enterFullscreen:(int)fuoptions background:(int)bg;
|
||||
- (void)leaveFullscreen;
|
||||
- (void)setFullscreenBackgroundColor:(int)color;
|
||||
- (void)enterFullScreen:(int)fuoptions background:(int)bg;
|
||||
- (void)leaveFullScreen;
|
||||
- (void)setFullScreenBackgroundColor:(int)color;
|
||||
|
||||
- (void)setAntialias:(BOOL)antialias;
|
||||
|
||||
|
||||
@@ -1150,27 +1150,27 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)enterFullscreen:(int)fuoptions background:(int)bg
|
||||
- (void)enterFullScreen:(int)fuoptions background:(int)bg
|
||||
{
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
[data appendBytes:&fuoptions length:sizeof(int)];
|
||||
bg = MM_COLOR(bg);
|
||||
[data appendBytes:&bg length:sizeof(int)];
|
||||
[self queueMessage:EnterFullscreenMsgID data:data];
|
||||
[self queueMessage:EnterFullScreenMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)leaveFullscreen
|
||||
- (void)leaveFullScreen
|
||||
{
|
||||
[self queueMessage:LeaveFullscreenMsgID data:nil];
|
||||
[self queueMessage:LeaveFullScreenMsgID data:nil];
|
||||
}
|
||||
|
||||
- (void)setFullscreenBackgroundColor:(int)color
|
||||
- (void)setFullScreenBackgroundColor:(int)color
|
||||
{
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
color = MM_COLOR(color);
|
||||
[data appendBytes:&color length:sizeof(int)];
|
||||
|
||||
[self queueMessage:SetFullscreenColorMsgID data:data];
|
||||
[self queueMessage:SetFullScreenColorMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)setAntialias:(BOOL)antialias
|
||||
@@ -1819,6 +1819,7 @@ static void netbeansReadCallback(CFSocketRef s,
|
||||
[NSNumber numberWithInt:p_mh], @"p_mh",
|
||||
[NSNumber numberWithBool:mmta], @"p_mmta",
|
||||
[NSNumber numberWithInt:numTabs], @"numTabs",
|
||||
[NSNumber numberWithInt:fuoptions_flags], @"fullScreenOptions",
|
||||
nil];
|
||||
|
||||
// Put the state before all other messages.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
@class MMVimView;
|
||||
|
||||
@interface MMFullscreenWindow : NSWindow {
|
||||
@interface MMFullScreenWindow : NSWindow {
|
||||
NSWindow *target;
|
||||
MMVimView *view;
|
||||
NSPoint oldPosition;
|
||||
@@ -22,7 +22,7 @@
|
||||
int options;
|
||||
int state;
|
||||
|
||||
// These are only valid in fullscreen mode and store pre-fu vim size
|
||||
// These are only valid in full-screen mode and store pre-fu vim size
|
||||
int nonFuRows, nonFuColumns;
|
||||
|
||||
// These store the size vim had right after entering fu mode
|
||||
@@ -32,14 +32,15 @@
|
||||
int startFuFlags;
|
||||
}
|
||||
|
||||
- (MMFullscreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
|
||||
- (MMFullScreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
|
||||
backgroundColor:(NSColor *)back;
|
||||
- (void)setOptions:(int)opt;
|
||||
- (void)enterFullscreen;
|
||||
- (void)leaveFullscreen;
|
||||
- (void)enterFullScreen;
|
||||
- (void)leaveFullScreen;
|
||||
- (void)centerView;
|
||||
|
||||
- (BOOL)canBecomeKeyWindow;
|
||||
- (BOOL)canBecomeMainWindow;
|
||||
|
||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification;
|
||||
@end
|
||||
@@ -8,7 +8,7 @@
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
/*
|
||||
* MMFullscreenWindow
|
||||
* MMFullScreenWindow
|
||||
*
|
||||
* A window without any decorations which covers an entire screen.
|
||||
*
|
||||
@@ -23,7 +23,7 @@
|
||||
* Author: Nico Weber
|
||||
*/
|
||||
|
||||
#import "MMFullscreenWindow.h"
|
||||
#import "MMFullScreenWindow.h"
|
||||
#import "MMTextView.h"
|
||||
#import "MMVimController.h"
|
||||
#import "MMVimView.h"
|
||||
@@ -45,18 +45,17 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
@interface MMFullscreenWindow (Private)
|
||||
@interface MMFullScreenWindow (Private)
|
||||
- (BOOL)isOnPrimaryScreen;
|
||||
- (void)windowDidBecomeMain:(NSNotification *)notification;
|
||||
- (void)windowDidResignMain:(NSNotification *)notification;
|
||||
- (void)windowDidMove:(NSNotification *)notification;
|
||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification;
|
||||
- (void)resizeVimView;
|
||||
@end
|
||||
|
||||
@implementation MMFullscreenWindow
|
||||
@implementation MMFullScreenWindow
|
||||
|
||||
- (MMFullscreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
|
||||
- (MMFullScreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
|
||||
backgroundColor:(NSColor *)back
|
||||
{
|
||||
NSScreen* screen = [t screen];
|
||||
@@ -103,11 +102,6 @@ enum {
|
||||
name:NSWindowDidMoveNotification
|
||||
object:self];
|
||||
|
||||
[nc addObserver:self
|
||||
selector:@selector(applicationDidChangeScreenParameters:)
|
||||
name:NSApplicationDidChangeScreenParametersNotification
|
||||
object:NSApp];
|
||||
|
||||
// NOTE: Vim needs to process mouse moved events, so enable them here.
|
||||
[self setAcceptsMouseMovedEvents:YES];
|
||||
|
||||
@@ -131,9 +125,9 @@ enum {
|
||||
options = opt;
|
||||
}
|
||||
|
||||
- (void)enterFullscreen
|
||||
- (void)enterFullScreen
|
||||
{
|
||||
ASLogDebug(@"Enter full screen now");
|
||||
ASLogDebug(@"Enter full-screen now");
|
||||
|
||||
// Hide Dock and menu bar now to avoid the hide animation from playing
|
||||
// after the fade to black (see also windowDidBecomeMain:).
|
||||
@@ -186,18 +180,18 @@ enum {
|
||||
// focus gained message
|
||||
[self setDelegate:delegate];
|
||||
|
||||
// Store view dimension used before entering full screen, then resize the
|
||||
// Store view dimension used before entering full-screen, then resize the
|
||||
// view to match 'fuopt'.
|
||||
[[view textView] getMaxRows:&nonFuRows columns:&nonFuColumns];
|
||||
[self resizeVimView];
|
||||
|
||||
// Store options used when entering full screen so that we can restore
|
||||
// dimensions when exiting full screen.
|
||||
// Store options used when entering full-screen so that we can restore
|
||||
// dimensions when exiting full-screen.
|
||||
startFuFlags = options;
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
// HACK! Put window on all Spaces to avoid Spaces (available on OS X 10.5
|
||||
// and later) from moving the full screen window to a separate Space from
|
||||
// and later) from moving the full-screen window to a separate Space from
|
||||
// the one the decorated window is occupying. The collection behavior is
|
||||
// restored further down.
|
||||
NSWindowCollectionBehavior wcb = [self collectionBehavior];
|
||||
@@ -223,7 +217,7 @@ enum {
|
||||
state = InFullScreen;
|
||||
}
|
||||
|
||||
- (void)leaveFullscreen
|
||||
- (void)leaveFullScreen
|
||||
{
|
||||
// fade to black
|
||||
Boolean didBlend = NO;
|
||||
@@ -272,10 +266,10 @@ enum {
|
||||
id delegate = [self delegate];
|
||||
[self setDelegate:nil];
|
||||
|
||||
// move text view back to original window, hide fullscreen window,
|
||||
// move text view back to original window, hide fullScreen window,
|
||||
// show original window
|
||||
// do this _after_ resetting delegate and window controller, so the
|
||||
// window controller doesn't get a focus lost message from the fullscreen
|
||||
// window controller doesn't get a focus lost message from the fullScreen
|
||||
// window.
|
||||
[view removeFromSuperviewWithoutNeedingDisplay];
|
||||
[[target contentView] addSubview:view];
|
||||
@@ -290,15 +284,30 @@ enum {
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
// HACK! Put decorated window on all Spaces (available on OS X 10.5 and
|
||||
// later) so that the decorated window stays on the same Space as the full
|
||||
// screen window (they may occupy different Spaces e.g. if the full screen
|
||||
// screen window (they may occupy different Spaces e.g. if the full-screen
|
||||
// window was dragged to another Space). The collection behavior is
|
||||
// restored further down.
|
||||
NSWindowCollectionBehavior wcb = [target collectionBehavior];
|
||||
[target setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
|
||||
#endif
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||
// HACK! On Mac OS X 10.7 windows animate when makeKeyAndOrderFront: is
|
||||
// called. This is distracting here, so disable the animation and restore
|
||||
// animation behavior after calling makeKeyAndOrderFront:.
|
||||
NSWindowAnimationBehavior a = NSWindowAnimationBehaviorNone;
|
||||
if ([target respondsToSelector:@selector(animationBehavior)]) {
|
||||
a = [target animationBehavior];
|
||||
[target setAnimationBehavior:NSWindowAnimationBehaviorNone];
|
||||
}
|
||||
#endif
|
||||
|
||||
[target makeKeyAndOrderFront:self];
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||
// HACK! Restore animation behavior.
|
||||
if (NSWindowAnimationBehaviorNone != a)
|
||||
[target setAnimationBehavior:a];
|
||||
#endif
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
||||
// Restore collection behavior (see hack above).
|
||||
[target setCollectionBehavior:wcb];
|
||||
@@ -318,7 +327,7 @@ enum {
|
||||
[self autorelease]; // Balance the above retain
|
||||
|
||||
state = LeftFullScreen;
|
||||
ASLogDebug(@"Left full screen");
|
||||
ASLogDebug(@"Left full-screen");
|
||||
}
|
||||
|
||||
// Title-less windows normally don't receive key presses, override this
|
||||
@@ -328,12 +337,40 @@ enum {
|
||||
}
|
||||
|
||||
// Title-less windows normally can't become main which means that another
|
||||
// non-fullscreen window will have the "active" titlebar in expose. Bad, fix it.
|
||||
// non-full-screen window will have the "active" titlebar in expose. Bad, fix
|
||||
// it.
|
||||
- (BOOL)canBecomeMainWindow
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification
|
||||
{
|
||||
if (state != InFullScreen)
|
||||
return;
|
||||
|
||||
// This notification is sent when screen resolution may have changed (e.g.
|
||||
// due to a monitor being unplugged or the resolution being changed
|
||||
// manually) but it also seems to get called when the Dock is
|
||||
// hidden/displayed.
|
||||
ASLogDebug(@"Screen unplugged / resolution changed");
|
||||
|
||||
NSScreen *screen = [target screen];
|
||||
if (!screen) {
|
||||
// Paranoia: if window we originally used for full-screen is gone, try
|
||||
// screen window is on now, and failing that (not sure this can happen)
|
||||
// use main screen.
|
||||
screen = [self screen];
|
||||
if (!screen)
|
||||
screen = [NSScreen mainScreen];
|
||||
}
|
||||
|
||||
// Ensure the full-screen window is still covering the entire screen and
|
||||
// then resize view according to 'fuopt'.
|
||||
[self setFrame:[screen frame] display:NO];
|
||||
[self resizeVimView];
|
||||
}
|
||||
|
||||
- (void)centerView
|
||||
{
|
||||
NSRect outer = [self frame], inner = [view frame];
|
||||
@@ -370,12 +407,12 @@ enum {
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end // MMFullscreenWindow
|
||||
@end // MMFullScreenWindow
|
||||
|
||||
|
||||
|
||||
|
||||
@implementation MMFullscreenWindow (Private)
|
||||
@implementation MMFullScreenWindow (Private)
|
||||
|
||||
- (BOOL)isOnPrimaryScreen
|
||||
{
|
||||
@@ -393,13 +430,13 @@ enum {
|
||||
{
|
||||
// Hide menu and dock, both appear on demand.
|
||||
//
|
||||
// Another way to deal with several fullscreen windows would be to hide/
|
||||
// reveal the dock only when the first fullscreen window is created and
|
||||
// Another way to deal with several full-screen windows would be to hide/
|
||||
// reveal the dock only when the first full-screen window is created and
|
||||
// show it again after the last one has been closed, but toggling on each
|
||||
// focus gain/loss works better with Spaces. The downside is that the
|
||||
// menu bar flashes shortly when switching between two fullscreen windows.
|
||||
// menu bar flashes shortly when switching between two full-screen windows.
|
||||
|
||||
// XXX: If you have a fullscreen window on a secondary monitor and unplug
|
||||
// XXX: If you have a full-screen window on a secondary monitor and unplug
|
||||
// the monitor, this will probably not work right.
|
||||
|
||||
if ([self isOnPrimaryScreen]) {
|
||||
@@ -421,41 +458,14 @@ enum {
|
||||
return;
|
||||
|
||||
// Window may move as a result of being dragged between Spaces.
|
||||
ASLogDebug(@"Full screen window moved, ensuring it covers the screen...");
|
||||
ASLogDebug(@"Full-screen window moved, ensuring it covers the screen...");
|
||||
|
||||
// Ensure the full screen window is still covering the entire screen and
|
||||
// Ensure the full-screen window is still covering the entire screen and
|
||||
// then resize view according to 'fuopt'.
|
||||
[self setFrame:[[self screen] frame] display:NO];
|
||||
[self resizeVimView];
|
||||
}
|
||||
|
||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification
|
||||
{
|
||||
if (state != InFullScreen)
|
||||
return;
|
||||
|
||||
// This notification is sent when screen resolution may have changed (e.g.
|
||||
// due to a monitor being unplugged or the resolution being changed
|
||||
// manually) but it also seems to get called when the Dock is
|
||||
// hidden/displayed.
|
||||
ASLogDebug(@"Screen unplugged / resolution changed");
|
||||
|
||||
NSScreen *screen = [target screen];
|
||||
if (!screen) {
|
||||
// Paranoia: if window we originally used for full screen is gone, try
|
||||
// screen window is on now, and failing that (not sure this can happen)
|
||||
// use main screen.
|
||||
screen = [self screen];
|
||||
if (!screen)
|
||||
screen = [NSScreen mainScreen];
|
||||
}
|
||||
|
||||
// Ensure the full screen window is still covering the entire screen and
|
||||
// then resize view according to 'fuopt'.
|
||||
[self setFrame:[screen frame] display:NO];
|
||||
[self resizeVimView];
|
||||
}
|
||||
|
||||
- (void)resizeVimView
|
||||
{
|
||||
// Resize vim view according to options
|
||||
@@ -503,9 +513,9 @@ enum {
|
||||
}
|
||||
|
||||
// The new view dimensions are stored and then consulted when attempting to
|
||||
// restore the windowed view dimensions when leaving full screen.
|
||||
// NOTE: Store them here and not only in enterFullscreen, otherwise the
|
||||
// windowed view dimensions will not be restored if the full screen was on
|
||||
// restore the windowed view dimensions when leaving full-screen.
|
||||
// NOTE: Store them here and not only in enterFullScreen, otherwise the
|
||||
// windowed view dimensions will not be restored if the full-screen was on
|
||||
// a screen that later was unplugged.
|
||||
startFuRows = fuRows;
|
||||
startFuColumns = fuColumns;
|
||||
@@ -513,4 +523,4 @@ enum {
|
||||
[self centerView];
|
||||
}
|
||||
|
||||
@end // MMFullscreenWindow (Private)
|
||||
@end // MMFullScreenWindow (Private)
|
||||
@@ -809,12 +809,12 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
#endif
|
||||
|
||||
imControl = enable;
|
||||
ASLogInfo(@"IM control %sabled", enable ? "en" : "dis");
|
||||
ASLogDebug(@"IM control %sabled", enable ? "en" : "dis");
|
||||
}
|
||||
|
||||
- (void)activateIm:(BOOL)enable
|
||||
{
|
||||
ASLogInfo(@"Activate IM=%d", enable);
|
||||
ASLogDebug(@"Activate IM=%d", enable);
|
||||
|
||||
// HACK: If there is marked text when switching IM it will be inserted as
|
||||
// normal text. To avoid this we abandon the marked text before switching.
|
||||
|
||||
@@ -27,8 +27,11 @@
|
||||
id backendProxy;
|
||||
NSMenu *mainMenu;
|
||||
NSMutableArray *popupMenuItems;
|
||||
|
||||
// TODO: Move all toolbar code to window controller?
|
||||
NSToolbar *toolbar;
|
||||
NSMutableDictionary *toolbarItemDict;
|
||||
|
||||
int pid;
|
||||
NSString *serverName;
|
||||
NSDictionary *vimState;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#import "MMWindowController.h"
|
||||
#import "Miscellaneous.h"
|
||||
#import "MMCoreTextView.h"
|
||||
#import "MMWindow.h"
|
||||
|
||||
|
||||
static NSString *MMDefaultToolbarImageName = @"Attention";
|
||||
@@ -765,15 +766,15 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
encoding:NSUTF8StringEncoding];
|
||||
[self setServerName:name];
|
||||
[name release];
|
||||
} else if (EnterFullscreenMsgID == msgid) {
|
||||
} else if (EnterFullScreenMsgID == msgid) {
|
||||
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 if (LeaveFullscreenMsgID == msgid) {
|
||||
[windowController leaveFullscreen];
|
||||
[windowController enterFullScreen:fuoptions backgroundColor:back];
|
||||
} else if (LeaveFullScreenMsgID == msgid) {
|
||||
[windowController leaveFullScreen];
|
||||
} else if (SetBuffersModifiedMsgID == msgid) {
|
||||
const void *bytes = [data bytes];
|
||||
// state < 0 <-> some buffer modified
|
||||
@@ -805,11 +806,11 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
}
|
||||
} else if (CloseWindowMsgID == msgid) {
|
||||
[self scheduleClose];
|
||||
} else if (SetFullscreenColorMsgID == msgid) {
|
||||
} else if (SetFullScreenColorMsgID == msgid) {
|
||||
const int *bg = (const int*)[data bytes];
|
||||
NSColor *color = [NSColor colorWithRgbInt:*bg];
|
||||
|
||||
[windowController setFullscreenBackgroundColor:color];
|
||||
[windowController setFullScreenBackgroundColor:color];
|
||||
} else if (ShowFindReplaceDialogMsgID == msgid) {
|
||||
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
|
||||
if (dict) {
|
||||
@@ -886,7 +887,12 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
- (void)savePanelDidEnd:(NSSavePanel *)panel code:(int)code
|
||||
context:(void *)context
|
||||
{
|
||||
NSString *path = (code == NSOKButton) ? [panel filename] : nil;
|
||||
NSString *path = nil;
|
||||
if (code == NSOKButton) {
|
||||
NSURL *url = [panel URL];
|
||||
if ([url isFileURL])
|
||||
path = [url path];
|
||||
}
|
||||
ASLogDebug(@"Open/save panel path=%@", path);
|
||||
|
||||
// NOTE! This causes the sheet animation to run its course BEFORE the rest
|
||||
@@ -1378,6 +1384,12 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
dir = [vimState objectForKey:@"pwd"];
|
||||
}
|
||||
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
|
||||
// 10.6+ APIs uses URLs instead of paths
|
||||
dir = [dir stringByExpandingTildeInPath];
|
||||
NSURL *dirURL = dir ? [NSURL fileURLWithPath:dir isDirectory:YES] : nil;
|
||||
#endif
|
||||
|
||||
if (saving) {
|
||||
NSSavePanel *panel = [NSSavePanel savePanel];
|
||||
|
||||
@@ -1387,22 +1399,47 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
[panel setDelegate:self];
|
||||
if ([panel isExpanded])
|
||||
[panel setAccessoryView:showHiddenFilesView()];
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
|
||||
// NOTE: -[NSSavePanel beginSheetForDirectory::::::] is deprecated on
|
||||
// 10.6 but -[NSSavePanel setDirectoryURL:] requires 10.6 so jump
|
||||
// through the following hoops on 10.6+.
|
||||
if (dirURL)
|
||||
[panel setDirectoryURL:dirURL];
|
||||
|
||||
[panel beginSheetModalForWindow:[windowController window]
|
||||
completionHandler:^(NSInteger result) {
|
||||
[self savePanelDidEnd:panel code:result context:nil];
|
||||
}];
|
||||
#else
|
||||
[panel beginSheetForDirectory:dir file:nil
|
||||
modalForWindow:[windowController window]
|
||||
modalDelegate:self
|
||||
didEndSelector:@selector(savePanelDidEnd:code:context:)
|
||||
contextInfo:NULL];
|
||||
#endif
|
||||
} else {
|
||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
[panel setAllowsMultipleSelection:NO];
|
||||
[panel setAccessoryView:showHiddenFilesView()];
|
||||
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
|
||||
// NOTE: -[NSOpenPanel beginSheetForDirectory:::::::] is deprecated on
|
||||
// 10.6 but -[NSOpenPanel setDirectoryURL:] requires 10.6 so jump
|
||||
// through the following hoops on 10.6+.
|
||||
if (dirURL)
|
||||
[panel setDirectoryURL:dirURL];
|
||||
|
||||
[panel beginSheetModalForWindow:[windowController window]
|
||||
completionHandler:^(NSInteger result) {
|
||||
[self savePanelDidEnd:panel code:result context:nil];
|
||||
}];
|
||||
#else
|
||||
[panel beginSheetForDirectory:dir file:nil types:nil
|
||||
modalForWindow:[windowController window]
|
||||
modalDelegate:self
|
||||
didEndSelector:@selector(savePanelDidEnd:code:context:)
|
||||
contextInfo:NULL];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1593,8 +1630,8 @@ isUnsafeMessage(int msgid)
|
||||
ExecuteActionMsgID, // Impossible to predict
|
||||
ShowPopupMenuMsgID, // Enters modal loop
|
||||
ActivateMsgID, // ?
|
||||
EnterFullscreenMsgID, // Modifies delegate of window controller
|
||||
LeaveFullscreenMsgID, // Modifies delegate of window controller
|
||||
EnterFullScreenMsgID, // Modifies delegate of window controller
|
||||
LeaveFullScreenMsgID, // Modifies delegate of window controller
|
||||
CloseWindowMsgID, // See note below
|
||||
BrowseForFileMsgID, // Enters modal loop
|
||||
ShowDialogMsgID, // Enters modal loop
|
||||
|
||||
@@ -29,4 +29,7 @@
|
||||
- (void)setContentMaxSize:(NSSize)size;
|
||||
- (void)setContentSize:(NSSize)size;
|
||||
|
||||
- (IBAction)toggleFullScreen:(id)sender;
|
||||
- (IBAction)realToggleFullScreen:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -152,4 +152,24 @@
|
||||
[[self delegate] performSelector:@selector(zoom:) withObject:sender];
|
||||
}
|
||||
|
||||
- (IBAction)toggleFullScreen:(id)sender
|
||||
{
|
||||
// HACK! This is an NSWindow method used to enter full-screen on OS X 10.7.
|
||||
// We override it so that we can interrupt and pass this on to Vim first.
|
||||
// An alternative hack would be to reroute the action message sent by the
|
||||
// full-screen button in the top right corner of a window, but there could
|
||||
// be other places where this action message is sent from.
|
||||
// To get to the original method (and enter Lion full-screen) we need to
|
||||
// call realToggleFullScreen: defined below.
|
||||
|
||||
// (Use performSelector:: to avoid compilation warning.)
|
||||
[[self delegate] performSelector:@selector(invFullScreen:) withObject:nil];
|
||||
}
|
||||
|
||||
- (IBAction)realToggleFullScreen:(id)sender
|
||||
{
|
||||
// HACK! See toggleFullScreen: comment above.
|
||||
[super toggleFullScreen:sender];
|
||||
}
|
||||
|
||||
@end // MMWindow
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
@class MMWindow;
|
||||
@class MMFullscreenWindow;
|
||||
@class MMFullScreenWindow;
|
||||
@class MMVimController;
|
||||
@class MMVimView;
|
||||
|
||||
@@ -31,15 +31,19 @@
|
||||
BOOL shouldRestoreUserTopLeft;
|
||||
int updateToolbarFlag;
|
||||
BOOL keepOnScreen;
|
||||
BOOL fullscreenEnabled;
|
||||
NSString *windowAutosaveKey;
|
||||
MMFullscreenWindow *fullscreenWindow;
|
||||
BOOL fullScreenEnabled;
|
||||
MMFullScreenWindow *fullScreenWindow;
|
||||
int fullScreenOptions;
|
||||
BOOL delayEnterFullScreen;
|
||||
NSRect preFullScreenFrame;
|
||||
MMWindow *decoratedWindow;
|
||||
NSString *lastSetTitle;
|
||||
int userRows;
|
||||
int userCols;
|
||||
NSPoint userTopLeft;
|
||||
NSPoint defaultTopLeft;
|
||||
NSToolbar *toolbar;
|
||||
}
|
||||
|
||||
- (id)initWithVimController:(MMVimController *)controller;
|
||||
@@ -75,9 +79,10 @@
|
||||
- (void)liveResizeWillStart;
|
||||
- (void)liveResizeDidEnd;
|
||||
|
||||
- (void)enterFullscreen:(int)fuoptions backgroundColor:(NSColor *)back;
|
||||
- (void)leaveFullscreen;
|
||||
- (void)setFullscreenBackgroundColor:(NSColor *)back;
|
||||
- (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back;
|
||||
- (void)leaveFullScreen;
|
||||
- (void)setFullScreenBackgroundColor:(NSColor *)back;
|
||||
- (void)invFullScreen:(id)sender;
|
||||
|
||||
- (void)setBufferModified:(BOOL)mod;
|
||||
- (void)setTopLeft:(NSPoint)pt;
|
||||
|
||||
+388
-72
@@ -44,7 +44,7 @@
|
||||
* YES & YES => NO
|
||||
*
|
||||
*
|
||||
* Resizing in full-screen mode:
|
||||
* Resizing in custom full-screen mode:
|
||||
*
|
||||
* The window never resizes since it fills the screen, however the vim view may
|
||||
* change size, e.g. when the user types ":set lines=60", or when a scrollbar
|
||||
@@ -52,13 +52,19 @@
|
||||
*
|
||||
* It is ensured that the vim view never becomes larger than the screen size
|
||||
* and that it always stays in the center of the screen.
|
||||
*
|
||||
*
|
||||
* Resizing in native full-screen mode (Mac OS X 10.7+):
|
||||
*
|
||||
* The window is always kept centered and resizing works more or less the same
|
||||
* way as in windowed mode.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "MMAppController.h"
|
||||
#import "MMAtsuiTextView.h"
|
||||
#import "MMFindReplaceController.h"
|
||||
#import "MMFullscreenWindow.h"
|
||||
#import "MMFullScreenWindow.h"
|
||||
#import "MMTextView.h"
|
||||
#import "MMTypesetter.h"
|
||||
#import "MMVimController.h"
|
||||
@@ -69,6 +75,12 @@
|
||||
#import <PSMTabBarControl/PSMTabBarControl.h>
|
||||
|
||||
|
||||
// These have to be the same as in option.h
|
||||
#define FUOPT_MAXVERT 0x001
|
||||
#define FUOPT_MAXHORZ 0x002
|
||||
#define FUOPT_BGCOLOR_HLGROUP 0x004
|
||||
|
||||
|
||||
|
||||
@interface MMWindowController (Private)
|
||||
- (NSSize)contentSize;
|
||||
@@ -82,6 +94,9 @@
|
||||
- (void)hideTablineSeparator:(BOOL)hide;
|
||||
- (void)doFindNext:(BOOL)next;
|
||||
- (void)updateToolbar;
|
||||
- (void)maximizeWindow:(int)options;
|
||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification;
|
||||
- (void)enterNativeFullScreen;
|
||||
@end
|
||||
|
||||
|
||||
@@ -181,6 +196,24 @@
|
||||
if ([win respondsToSelector:@selector(_setContentHasShadow:)])
|
||||
[win _setContentHasShadow:NO];
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||
// Building on Mac OS X 10.7 or greater.
|
||||
|
||||
// This puts the full-screen button in the top right of each window
|
||||
if ([win respondsToSelector:@selector(setCollectionBehavior:)])
|
||||
[win setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
|
||||
// This makes windows animate when opened
|
||||
if ([win respondsToSelector:@selector(setAnimationBehavior:)])
|
||||
[win setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow];
|
||||
#endif
|
||||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver:self
|
||||
selector:@selector(applicationDidChangeScreenParameters:)
|
||||
name:NSApplicationDidChangeScreenParametersNotification
|
||||
object:NSApp];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -191,6 +224,7 @@
|
||||
[decoratedWindow release]; decoratedWindow = nil;
|
||||
[windowAutosaveKey release]; windowAutosaveKey = nil;
|
||||
[vimView release]; vimView = nil;
|
||||
[toolbar release]; toolbar = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
@@ -226,16 +260,20 @@
|
||||
|
||||
- (void)cleanup
|
||||
{
|
||||
ASLogDebug(@"%@ %s", [self className], _cmd);
|
||||
ASLogDebug(@"");
|
||||
|
||||
if (fullscreenEnabled) {
|
||||
// If we are closed while still in fullscreen, end fullscreen mode,
|
||||
// NOTE: Must set this before possibly leaving full-screen.
|
||||
setupDone = NO;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
if (fullScreenEnabled) {
|
||||
// If we are closed while still in full-screen, end full-screen mode,
|
||||
// release ourselves (because this won't happen in MMWindowController)
|
||||
// and perform close operation on the original window.
|
||||
[self leaveFullscreen];
|
||||
[self leaveFullScreen];
|
||||
}
|
||||
|
||||
setupDone = NO;
|
||||
vimController = nil;
|
||||
|
||||
[vimView removeFromSuperviewWithoutNeedingDisplay];
|
||||
@@ -277,17 +315,32 @@
|
||||
[self updateResizeConstraints];
|
||||
[self resizeWindowToFitContentSize:[vimView desiredSize]
|
||||
keepOnScreen:YES];
|
||||
[[self window] makeKeyAndOrderFront:self];
|
||||
|
||||
|
||||
[decoratedWindow makeKeyAndOrderFront:self];
|
||||
|
||||
// HACK! Calling makeKeyAndOrderFront: may cause Cocoa to force the window
|
||||
// into native full-screen mode (this happens e.g. if a new window is
|
||||
// opened when MacVim is already in full-screen). In this case we don't
|
||||
// want the decorated window to pop up before the animation into
|
||||
// full-screen, so set its alpha to 0.
|
||||
if (fullScreenEnabled && !fullScreenWindow)
|
||||
[decoratedWindow setAlphaValue:0];
|
||||
|
||||
// Flag that the window is now placed on screen. From now on it is OK for
|
||||
// code to depend on the screen state. (Such as constraining views etc.)
|
||||
windowPresented = YES;
|
||||
|
||||
if (fullscreenWindow) {
|
||||
// Delayed entering of full screen happens here (a ":set fu" in a
|
||||
if (fullScreenWindow) {
|
||||
// Delayed entering of full-screen happens here (a ":set fu" in a
|
||||
// GUIEnter auto command could cause this).
|
||||
[fullscreenWindow enterFullscreen];
|
||||
fullscreenEnabled = YES;
|
||||
[fullScreenWindow enterFullScreen];
|
||||
fullScreenEnabled = YES;
|
||||
} else if (delayEnterFullScreen) {
|
||||
// Set alpha to zero so that the decorated window doesn't pop up
|
||||
// before we enter full-screen.
|
||||
[decoratedWindow setAlphaValue:0];
|
||||
[self enterNativeFullScreen];
|
||||
}
|
||||
|
||||
return YES;
|
||||
@@ -352,12 +405,12 @@
|
||||
return;
|
||||
|
||||
[decoratedWindow setTitle:title];
|
||||
if (fullscreenEnabled) {
|
||||
[fullscreenWindow setTitle:title];
|
||||
if (fullScreenWindow) {
|
||||
[fullScreenWindow setTitle:title];
|
||||
|
||||
// NOTE: Cocoa does not update the "Window" menu for borderless windows
|
||||
// so we have to do it manually.
|
||||
[NSApp changeWindowsItem:fullscreenWindow title:title filename:NO];
|
||||
[NSApp changeWindowsItem:fullScreenWindow title:title filename:NO];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,12 +425,17 @@
|
||||
filename = @"";
|
||||
|
||||
[decoratedWindow setRepresentedFilename:filename];
|
||||
[fullscreenWindow setRepresentedFilename:filename];
|
||||
[fullScreenWindow setRepresentedFilename:filename];
|
||||
}
|
||||
|
||||
- (void)setToolbar:(NSToolbar *)toolbar
|
||||
- (void)setToolbar:(NSToolbar *)theToolbar
|
||||
{
|
||||
// The full-screen window has no toolbar.
|
||||
if (theToolbar != toolbar) {
|
||||
[toolbar release];
|
||||
toolbar = [theToolbar retain];
|
||||
}
|
||||
|
||||
// NOTE: Toolbar must be set here or it won't work to show it later.
|
||||
[decoratedWindow setToolbar:toolbar];
|
||||
|
||||
// HACK! Redirect the pill button so that we can ask Vim to hide the
|
||||
@@ -429,8 +487,8 @@
|
||||
// flag on the window here (should be faster if the window is opaque).
|
||||
BOOL isOpaque = [back alphaComponent] == 1.0f;
|
||||
[decoratedWindow setOpaque:isOpaque];
|
||||
if (fullscreenEnabled)
|
||||
[fullscreenWindow setOpaque:isOpaque];
|
||||
if (fullScreenWindow)
|
||||
[fullScreenWindow setOpaque:isOpaque];
|
||||
|
||||
[vimView setDefaultColorsBackground:back foreground:fore];
|
||||
}
|
||||
@@ -477,25 +535,26 @@
|
||||
toSize:contentSize];
|
||||
[vimView setFrameSize:contentSize];
|
||||
|
||||
if (fullscreenEnabled) {
|
||||
// NOTE! Don't mark the fullscreen content view as needing an
|
||||
if (fullScreenWindow) {
|
||||
// NOTE! Don't mark the full-screen content view as needing an
|
||||
// update unless absolutely necessary since when it is updated the
|
||||
// entire screen is cleared. This may cause some parts of the Vim
|
||||
// view to be cleared but not redrawn since Vim does not realize
|
||||
// that we've erased part of the view.
|
||||
if (!NSEqualSizes(originalSize, contentSize)) {
|
||||
[[fullscreenWindow contentView] setNeedsDisplay:YES];
|
||||
[fullscreenWindow centerView];
|
||||
[[fullScreenWindow contentView] setNeedsDisplay:YES];
|
||||
[fullScreenWindow centerView];
|
||||
}
|
||||
} else {
|
||||
[self resizeWindowToFitContentSize:contentSize
|
||||
keepOnScreen:keepOnScreen];
|
||||
|
||||
if (windowAutosaveKey && rows > 0 && cols > 0) {
|
||||
if (!fullScreenEnabled && windowAutosaveKey && rows > 0 &&
|
||||
cols > 0) {
|
||||
// Autosave rows and columns now that they should have been
|
||||
// constrained to fit on screen. We only do this for the
|
||||
// window which also autosaves window position and we avoid
|
||||
// autosaving when in fullscreen since the rows usually won't
|
||||
// autosaving when in full-screen since the rows usually won't
|
||||
// fit when in windowed mode.
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
[ud setInteger:rows forKey:MMAutosaveRowsKey];
|
||||
@@ -515,10 +574,9 @@
|
||||
// Showing the tabline may result in the tabline separator being hidden or
|
||||
// shown; this does not apply to full-screen mode.
|
||||
if (!on) {
|
||||
NSToolbar *toolbar = [decoratedWindow toolbar];
|
||||
if (([decoratedWindow styleMask] & NSTexturedBackgroundWindowMask)
|
||||
== 0) {
|
||||
[self hideTablineSeparator:![toolbar isVisible]];
|
||||
[self hideTablineSeparator:![decoratedWindow toolbar]];
|
||||
} else {
|
||||
[self hideTablineSeparator:NO];
|
||||
}
|
||||
@@ -534,7 +592,6 @@
|
||||
|
||||
- (void)showToolbar:(BOOL)on size:(int)size mode:(int)mode
|
||||
{
|
||||
NSToolbar *toolbar = [decoratedWindow toolbar];
|
||||
if (!toolbar) return;
|
||||
|
||||
[toolbar setSizeMode:size];
|
||||
@@ -633,58 +690,95 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)enterFullscreen:(int)fuoptions backgroundColor:(NSColor *)back
|
||||
- (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back
|
||||
{
|
||||
if (fullscreenEnabled) return;
|
||||
if (fullScreenEnabled) return;
|
||||
|
||||
// fullscreenWindow could be nil here if this is called multiple times
|
||||
// during startup.
|
||||
[fullscreenWindow release];
|
||||
BOOL useNativeFullScreen = [[NSUserDefaults standardUserDefaults]
|
||||
boolForKey:MMNativeFullScreenKey];
|
||||
// Make sure user is not trying to use native full-screen on systems that
|
||||
// do not support it.
|
||||
if (![NSWindow instancesRespondToSelector:@selector(toggleFullScreen:)])
|
||||
useNativeFullScreen = NO;
|
||||
|
||||
fullscreenWindow = [[MMFullscreenWindow alloc]
|
||||
initWithWindow:decoratedWindow view:vimView backgroundColor:back];
|
||||
[fullscreenWindow setOptions:fuoptions];
|
||||
[fullscreenWindow setRepresentedFilename:
|
||||
[decoratedWindow representedFilename]];
|
||||
|
||||
// NOTE: Do not enter full screen until the window has been presented since
|
||||
// we don't actually know which screen to use before then.
|
||||
if (windowPresented) {
|
||||
[fullscreenWindow enterFullscreen];
|
||||
fullscreenEnabled = YES;
|
||||
|
||||
// The resize handle disappears so the vim view needs to update the
|
||||
// scrollbars.
|
||||
shouldResizeVimView = YES;
|
||||
if (useNativeFullScreen) {
|
||||
// Enter native full-screen mode. Only supported on Mac OS X 10.7+.
|
||||
fullScreenOptions = fuoptions;
|
||||
if (windowPresented) {
|
||||
[self enterNativeFullScreen];
|
||||
} else {
|
||||
delayEnterFullScreen = YES;
|
||||
}
|
||||
} else {
|
||||
ASLogDebug(@"Delay enter full screen");
|
||||
// Enter custom full-screen mode. Always supported.
|
||||
ASLogInfo(@"Enter custom full-screen");
|
||||
|
||||
// fullScreenWindow could be non-nil here if this is called multiple
|
||||
// times during startup.
|
||||
[fullScreenWindow release];
|
||||
|
||||
fullScreenWindow = [[MMFullScreenWindow alloc]
|
||||
initWithWindow:decoratedWindow view:vimView backgroundColor:back];
|
||||
[fullScreenWindow setOptions:fuoptions];
|
||||
[fullScreenWindow setRepresentedFilename:
|
||||
[decoratedWindow representedFilename]];
|
||||
|
||||
// NOTE: Do not enter full-screen until the window has been presented
|
||||
// since we don't actually know which screen to use before then. (The
|
||||
// custom full-screen can appear on any screen, as opposed to native
|
||||
// full-screen which always uses the main screen.)
|
||||
if (windowPresented) {
|
||||
[fullScreenWindow enterFullScreen];
|
||||
fullScreenEnabled = YES;
|
||||
|
||||
// The resize handle disappears so the vim view needs to update the
|
||||
// scrollbars.
|
||||
shouldResizeVimView = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)leaveFullscreen
|
||||
- (void)leaveFullScreen
|
||||
{
|
||||
if (!fullscreenEnabled) return;
|
||||
if (!fullScreenEnabled) return;
|
||||
|
||||
fullscreenEnabled = NO;
|
||||
[fullscreenWindow leaveFullscreen];
|
||||
[fullscreenWindow release];
|
||||
fullscreenWindow = nil;
|
||||
ASLogInfo(@"Exit full-screen");
|
||||
|
||||
// The vim view may be too large to fit the screen, so update it.
|
||||
shouldResizeVimView = YES;
|
||||
fullScreenEnabled = NO;
|
||||
if (fullScreenWindow) {
|
||||
// Using custom full-screen
|
||||
[fullScreenWindow leaveFullScreen];
|
||||
[fullScreenWindow release];
|
||||
fullScreenWindow = nil;
|
||||
|
||||
// The vim view may be too large to fit the screen, so update it.
|
||||
shouldResizeVimView = YES;
|
||||
} else {
|
||||
// Using native full-screen
|
||||
// NOTE: fullScreenEnabled is used to detect if we enter full-screen
|
||||
// programatically and so must be set before calling
|
||||
// realToggleFullScreen:.
|
||||
NSParameterAssert(fullScreenEnabled == NO);
|
||||
[decoratedWindow realToggleFullScreen:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setFullscreenBackgroundColor:(NSColor *)back
|
||||
- (void)setFullScreenBackgroundColor:(NSColor *)back
|
||||
{
|
||||
if (fullscreenWindow)
|
||||
[fullscreenWindow setBackgroundColor:back];
|
||||
if (fullScreenWindow)
|
||||
[fullScreenWindow setBackgroundColor:back];
|
||||
}
|
||||
|
||||
- (void)invFullScreen:(id)sender
|
||||
{
|
||||
[vimController addVimInput:@"<C-\\><C-N>:set invfu<CR>"];
|
||||
}
|
||||
|
||||
- (void)setBufferModified:(BOOL)mod
|
||||
{
|
||||
// NOTE: We only set the document edited flag on the decorated window since
|
||||
// the full-screen window has no close button anyway. (It also saves us
|
||||
// from keeping track of the flag in two different places.)
|
||||
// the custom full-screen window has no close button anyway. (It also
|
||||
// saves us from keeping track of the flag in two different places.)
|
||||
[decoratedWindow setDocumentEdited:mod];
|
||||
}
|
||||
|
||||
@@ -855,7 +949,7 @@
|
||||
if (!setupDone)
|
||||
return;
|
||||
|
||||
if (fullscreenEnabled) {
|
||||
if (fullScreenEnabled) {
|
||||
// NOTE: The full-screen is not supposed to be able to be moved. If we
|
||||
// do get here while in full-screen something unexpected happened (e.g.
|
||||
// the full-screen window was on an external display that got
|
||||
@@ -884,7 +978,7 @@
|
||||
|
||||
- (void)windowDidResize:(id)sender
|
||||
{
|
||||
if (!setupDone || fullscreenEnabled) return;
|
||||
if (!setupDone || fullScreenEnabled) return;
|
||||
|
||||
// NOTE: Since we have no control over when the window may resize (Cocoa
|
||||
// may resize automatically) we simply set the view to fill the entire
|
||||
@@ -994,6 +1088,146 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||
|
||||
// -- Full-screen delegate ---------------------------------------------------
|
||||
|
||||
- (NSApplicationPresentationOptions)window:(NSWindow *)window
|
||||
willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)opt
|
||||
{
|
||||
return opt | NSApplicationPresentationAutoHideToolbar;
|
||||
}
|
||||
|
||||
- (NSArray *)customWindowsToEnterFullScreenForWindow:(NSWindow *)window
|
||||
{
|
||||
return [NSArray arrayWithObject:decoratedWindow];
|
||||
}
|
||||
|
||||
- (void)window:(NSWindow *)window
|
||||
startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration
|
||||
{
|
||||
// Fade out window, remove title bar and maximize, then fade back in.
|
||||
// (There is a small delay before window is maximized but usually this is
|
||||
// not noticeable on a relatively modern Mac.)
|
||||
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
|
||||
[context setDuration:0.5*duration];
|
||||
[[window animator] setAlphaValue:0];
|
||||
} completionHandler:^{
|
||||
[window setStyleMask:([window styleMask] | NSFullScreenWindowMask)];
|
||||
[[vimView tabBarControl] setStyleNamed:@"Unified"];
|
||||
[self maximizeWindow:fullScreenOptions];
|
||||
|
||||
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
|
||||
[context setDuration:0.5*duration];
|
||||
[[window animator] setAlphaValue:1];
|
||||
} completionHandler:^{
|
||||
// Do nothing
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)windowWillEnterFullScreen:(NSNotification *)notification
|
||||
{
|
||||
// Store window frame and use it when exiting full-screen.
|
||||
preFullScreenFrame = [decoratedWindow frame];
|
||||
|
||||
// ASSUMPTION: fullScreenEnabled always reflects the state of Vim's 'fu'.
|
||||
if (!fullScreenEnabled) {
|
||||
ASLogDebug(@"Full-screen out of sync, tell Vim to set 'fu'");
|
||||
// NOTE: If we get here it means that Cocoa has somehow entered
|
||||
// full-screen without us getting to set the 'fu' option first, so Vim
|
||||
// and the GUI are out of sync. The following code (eventually) gets
|
||||
// them back into sync. A problem is that the full-screen options have
|
||||
// not been set, so we have to cache that state and grab it here.
|
||||
fullScreenOptions = [[vimController objectForVimStateKey:
|
||||
@"fullScreenOptions"] intValue];
|
||||
fullScreenEnabled = YES;
|
||||
[self invFullScreen:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)windowDidFailToEnterFullScreen:(NSWindow *)window
|
||||
{
|
||||
// NOTE: This message can be called without
|
||||
// window:startCustomAnimationToEnterFullScreenWithDuration: ever having
|
||||
// been called so any state to store before entering full-screen must be
|
||||
// stored in windowWillEnterFullScreen: which always gets called.
|
||||
ASLogNotice(@"Failed to ENTER full-screen, restoring window frame...");
|
||||
|
||||
fullScreenEnabled = NO;
|
||||
[window setAlphaValue:1];
|
||||
[window setStyleMask:([window styleMask] & ~NSFullScreenWindowMask)];
|
||||
[[vimView tabBarControl] setStyleNamed:@"Metal"];
|
||||
[window setFrame:preFullScreenFrame display:YES];
|
||||
}
|
||||
|
||||
- (NSArray *)customWindowsToExitFullScreenForWindow:(NSWindow *)window
|
||||
{
|
||||
return [NSArray arrayWithObject:decoratedWindow];
|
||||
}
|
||||
|
||||
- (void)window:(NSWindow *)window
|
||||
startCustomAnimationToExitFullScreenWithDuration:(NSTimeInterval)duration
|
||||
{
|
||||
if (!setupDone) {
|
||||
// HACK! The window has closed but Cocoa still brings it back to life
|
||||
// and shows a grey box the size of the window unless we explicitly
|
||||
// hide it by setting its alpha to 0 here.
|
||||
[window setAlphaValue:0];
|
||||
return;
|
||||
}
|
||||
|
||||
// Fade out window, add back title bar and restore window frame, then fade
|
||||
// back in. (There is a small delay before window contents is drawn after
|
||||
// the window frame is set but usually this is not noticeable on a
|
||||
// relatively modern Mac.)
|
||||
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
|
||||
[context setDuration:0.5*duration];
|
||||
[[window animator] setAlphaValue:0];
|
||||
} completionHandler:^{
|
||||
[window setStyleMask:([window styleMask] & ~NSFullScreenWindowMask)];
|
||||
[[vimView tabBarControl] setStyleNamed:@"Metal"];
|
||||
[window setFrame:preFullScreenFrame display:YES];
|
||||
|
||||
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
|
||||
[context setDuration:0.5*duration];
|
||||
[[window animator] setAlphaValue:1];
|
||||
} completionHandler:^{
|
||||
// Do nothing
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)windowWillExitFullScreen:(NSNotification *)notification
|
||||
{
|
||||
// ASSUMPTION: fullScreenEnabled always reflects the state of Vim's 'fu'.
|
||||
if (fullScreenEnabled) {
|
||||
ASLogDebug(@"Full-screen out of sync, tell Vim to clear 'fu'");
|
||||
// NOTE: If we get here it means that Cocoa has somehow exited
|
||||
// full-screen without us getting to clear the 'fu' option first, so
|
||||
// Vim and the GUI are out of sync. The following code (eventually)
|
||||
// gets them back into sync.
|
||||
fullScreenEnabled = NO;
|
||||
[self invFullScreen:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)windowDidFailToExitFullScreen:(NSWindow *)window
|
||||
{
|
||||
// TODO: Is this the correct way to deal with this message? Are we still
|
||||
// in full-screen at this point?
|
||||
ASLogNotice(@"Failed to EXIT full-screen, maximizing window...");
|
||||
|
||||
fullScreenEnabled = YES;
|
||||
[window setAlphaValue:1];
|
||||
[window setStyleMask:([window styleMask] | NSFullScreenWindowMask)];
|
||||
[[vimView tabBarControl] setStyleNamed:@"Unified"];
|
||||
[self maximizeWindow:fullScreenOptions];
|
||||
}
|
||||
|
||||
#endif // (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
|
||||
|
||||
@end // MMWindowController
|
||||
|
||||
|
||||
@@ -1029,13 +1263,13 @@
|
||||
shouldRestoreUserTopLeft = NO;
|
||||
}
|
||||
|
||||
if (onScreen && [decoratedWindow screen]) {
|
||||
NSScreen *screen = [decoratedWindow screen];
|
||||
if (onScreen && screen) {
|
||||
// Ensure that the window fits inside the visible part of the screen.
|
||||
// If there are more than one screen the window will be moved to fit
|
||||
// entirely in the screen that most of it occupies.
|
||||
// NOTE: Not called in full-screen mode so use "visibleFrame' instead
|
||||
// of "frame".
|
||||
NSRect maxFrame = [[decoratedWindow screen] visibleFrame];
|
||||
NSRect maxFrame = fullScreenEnabled ? [screen frame]
|
||||
: [screen visibleFrame];
|
||||
maxFrame = [self constrainFrame:maxFrame];
|
||||
|
||||
if (newFrame.size.width > maxFrame.size.width) {
|
||||
@@ -1057,6 +1291,15 @@
|
||||
newFrame.origin.x = NSMaxX(maxFrame) - newFrame.size.width;
|
||||
}
|
||||
|
||||
if (fullScreenEnabled && screen) {
|
||||
// Keep window centered when in native full-screen.
|
||||
NSRect screenFrame = [screen frame];
|
||||
newFrame.origin.y = screenFrame.origin.y +
|
||||
round(0.5*(screenFrame.size.height - newFrame.size.height));
|
||||
newFrame.origin.x = screenFrame.origin.x +
|
||||
round(0.5*(screenFrame.size.width - newFrame.size.width));
|
||||
}
|
||||
|
||||
[decoratedWindow setFrame:newFrame display:YES];
|
||||
|
||||
NSPoint oldTopLeft = { frame.origin.x, NSMaxY(frame) };
|
||||
@@ -1083,7 +1326,7 @@
|
||||
// NOTE: This may be called in both windowed and full-screen mode. The
|
||||
// "visibleFrame" method does not overlap menu and dock so should not be
|
||||
// used in full-screen.
|
||||
NSRect screenRect = fullscreenEnabled ? [[win screen] frame]
|
||||
NSRect screenRect = fullScreenEnabled ? [[win screen] frame]
|
||||
: [[win screen] visibleFrame];
|
||||
NSRect rect = [win contentRectForFrameRect:screenRect];
|
||||
|
||||
@@ -1203,12 +1446,11 @@
|
||||
|
||||
- (void)updateToolbar
|
||||
{
|
||||
NSToolbar *toolbar = [decoratedWindow toolbar];
|
||||
if (nil == toolbar || 0 == updateToolbarFlag) return;
|
||||
|
||||
// Positive flag shows toolbar, negative hides it.
|
||||
BOOL on = updateToolbarFlag > 0 ? YES : NO;
|
||||
[toolbar setVisible:on];
|
||||
[decoratedWindow setToolbar:(on ? toolbar : nil)];
|
||||
|
||||
if (([decoratedWindow styleMask] & NSTexturedBackgroundWindowMask) == 0) {
|
||||
if (!on) {
|
||||
@@ -1227,4 +1469,78 @@
|
||||
updateToolbarFlag = 0;
|
||||
}
|
||||
|
||||
- (void)maximizeWindow:(int)options
|
||||
{
|
||||
int currRows, currColumns;
|
||||
[[vimView textView] getMaxRows:&currRows columns:&currColumns];
|
||||
|
||||
// NOTE: Do not use [NSScreen visibleFrame] when determining the screen
|
||||
// size since it compensates for menu and dock.
|
||||
int maxRows, maxColumns;
|
||||
NSSize size = [[NSScreen mainScreen] frame].size;
|
||||
[vimView constrainRows:&maxRows columns:&maxColumns toSize:size];
|
||||
|
||||
ASLogDebug(@"max: %dx%d curr: %dx%d",
|
||||
maxRows, maxColumns, currRows, currColumns);
|
||||
|
||||
// Compute current fu size
|
||||
int fuRows = currRows, fuColumns = currColumns;
|
||||
if (options & FUOPT_MAXVERT)
|
||||
fuRows = maxRows;
|
||||
if (options & FUOPT_MAXHORZ)
|
||||
fuColumns = maxColumns;
|
||||
|
||||
// If necessary, resize vim to target fu size
|
||||
if (currRows != fuRows || currColumns != fuColumns) {
|
||||
// The size sent here is queued and sent to vim when it's in
|
||||
// event processing mode again. Make sure to only send the values we
|
||||
// care about, as they override any changes that were made to 'lines'
|
||||
// and 'columns' after 'fu' was set but before the event loop is run.
|
||||
NSData *data = nil;
|
||||
int msgid = 0;
|
||||
if (currRows != fuRows && currColumns != fuColumns) {
|
||||
int newSize[2] = { fuRows, fuColumns };
|
||||
data = [NSData dataWithBytes:newSize length:2*sizeof(int)];
|
||||
msgid = SetTextDimensionsMsgID;
|
||||
} else if (currRows != fuRows) {
|
||||
data = [NSData dataWithBytes:&fuRows length:sizeof(int)];
|
||||
msgid = SetTextRowsMsgID;
|
||||
} else if (currColumns != fuColumns) {
|
||||
data = [NSData dataWithBytes:&fuColumns length:sizeof(int)];
|
||||
msgid = SetTextColumnsMsgID;
|
||||
}
|
||||
NSParameterAssert(data != nil && msgid != 0);
|
||||
|
||||
MMVimController *vc = [self vimController];
|
||||
[vc sendMessage:msgid data:data];
|
||||
[[vimView textView] setMaxRows:fuRows columns:fuColumns];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification
|
||||
{
|
||||
if (fullScreenWindow) {
|
||||
[fullScreenWindow applicationDidChangeScreenParameters:notification];
|
||||
} else if (fullScreenEnabled) {
|
||||
ASLogDebug(@"Re-maximizing full-screen window...");
|
||||
[self maximizeWindow:fullScreenOptions];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)enterNativeFullScreen
|
||||
{
|
||||
if (fullScreenEnabled)
|
||||
return;
|
||||
|
||||
ASLogInfo(@"Enter native full-screen");
|
||||
|
||||
fullScreenEnabled = YES;
|
||||
|
||||
// NOTE: fullScreenEnabled is used to detect if we enter full-screen
|
||||
// programatically and so must be set before calling realToggleFullScreen:.
|
||||
NSParameterAssert(fullScreenEnabled == YES);
|
||||
[decoratedWindow realToggleFullScreen:self];
|
||||
}
|
||||
|
||||
@end // MMWindowController (Private)
|
||||
|
||||
|
||||
+6
-3
@@ -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
|
||||
|
||||
|
||||
//
|
||||
@@ -156,8 +159,8 @@ enum {
|
||||
AdjustLinespaceMsgID,
|
||||
ActivateMsgID,
|
||||
SetServerNameMsgID,
|
||||
EnterFullscreenMsgID,
|
||||
LeaveFullscreenMsgID,
|
||||
EnterFullScreenMsgID,
|
||||
LeaveFullScreenMsgID,
|
||||
SetBuffersModifiedMsgID,
|
||||
AddInputMsgID,
|
||||
SetPreEditPositionMsgID,
|
||||
@@ -169,7 +172,7 @@ enum {
|
||||
SetDocumentFilenameMsgID,
|
||||
OpenWithArgumentsMsgID,
|
||||
CloseWindowMsgID,
|
||||
SetFullscreenColorMsgID,
|
||||
SetFullScreenColorMsgID,
|
||||
ShowFindReplaceDialogMsgID,
|
||||
FindReplaceMsgID,
|
||||
ActivateKeyScriptMsgID,
|
||||
|
||||
+3
-3
@@ -66,8 +66,8 @@ char *MessageStrings[] =
|
||||
"AdjustLinespaceMsgID",
|
||||
"ActivateMsgID",
|
||||
"SetServerNameMsgID",
|
||||
"EnterFullscreenMsgID",
|
||||
"LeaveFullscreenMsgID",
|
||||
"EnterFullScreenMsgID",
|
||||
"LeaveFullScreenMsgID",
|
||||
"SetBuffersModifiedMsgID",
|
||||
"AddInputMsgID",
|
||||
"SetPreEditPositionMsgID",
|
||||
@@ -79,7 +79,7 @@ char *MessageStrings[] =
|
||||
"SetDocumentFilenameMsgID",
|
||||
"OpenWithArgumentsMsgID",
|
||||
"CloseWindowMsgID",
|
||||
"SetFullscreenColorMsgID",
|
||||
"SetFullScreenColorMsgID",
|
||||
"ShowFindReplaceDialogMsgID",
|
||||
"FindReplaceMsgID",
|
||||
"ActivateKeyScriptMsgID",
|
||||
|
||||
@@ -622,7 +622,7 @@
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 60;
|
||||
CURRENT_PROJECT_VERSION = 61;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
@@ -652,7 +652,7 @@
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 60;
|
||||
CURRENT_PROJECT_VERSION = 61;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
|
||||
@@ -679,6 +679,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
GCC_VERSION = 4.2;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
@@ -691,6 +692,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
GCC_VERSION = 4.2;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
|
||||
@@ -53,6 +53,7 @@ extern NSString *MMLastWindowClosedBehaviorKey;
|
||||
extern NSString *MMUseInlineImKey;
|
||||
#endif // INCLUDE_OLD_IM_CODE
|
||||
extern NSString *MMSuppressTerminationAlertKey;
|
||||
extern NSString *MMNativeFullScreenKey;
|
||||
|
||||
|
||||
// Enum for MMUntitledWindowKey
|
||||
|
||||
@@ -45,6 +45,7 @@ NSString *MMLastWindowClosedBehaviorKey = @"MMLastWindowClosedBehavior";
|
||||
NSString *MMUseInlineImKey = @"MMUseInlineIm";
|
||||
#endif // INCLUDE_OLD_IM_CODE
|
||||
NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
|
||||
NSString *MMNativeFullScreenKey = @"MMNativeFullScreen";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -417,7 +417,11 @@
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = C056398B08A954F8003078D8 /* Build configuration list for PBXProject "PSMTabBarControl" */;
|
||||
compatibilityVersion = "Xcode 2.4";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 0259C574FE90428111CA0C5A /* PSMTabBarControl */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
@@ -547,6 +551,7 @@
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
|
||||
GCC_VERSION = 4.2;
|
||||
INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist";
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
@@ -568,6 +573,7 @@
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
|
||||
GCC_VERSION = 4.2;
|
||||
INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist";
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
|
||||
@@ -418,6 +418,7 @@
|
||||
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
|
||||
}
|
||||
|
||||
#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best.
|
||||
// icon
|
||||
if([cell hasIcon]){
|
||||
NSRect iconRect = [self iconRectForTabCell:cell];
|
||||
@@ -430,7 +431,8 @@
|
||||
// scoot label over
|
||||
labelPosition += iconRect.size.width + kPSMTabBarCellPadding;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// object counter
|
||||
if([cell count] > 0){
|
||||
[[NSColor colorWithCalibratedWhite:0.3 alpha:0.45] set];
|
||||
@@ -451,8 +453,7 @@
|
||||
counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5;
|
||||
[counterString drawInRect:counterStringRect];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// label rect
|
||||
NSRect labelRect;
|
||||
labelRect.origin.x = labelPosition;
|
||||
|
||||
@@ -402,7 +402,8 @@ void MyNSDrawWindowBackground(NSRect rect)
|
||||
// scoot label over
|
||||
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
|
||||
}
|
||||
|
||||
|
||||
#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best.
|
||||
// icon
|
||||
if([cell hasIcon]){
|
||||
NSRect iconRect = [self iconRectForTabCell:cell];
|
||||
@@ -415,7 +416,8 @@ void MyNSDrawWindowBackground(NSRect rect)
|
||||
// scoot label over
|
||||
labelPosition += iconRect.size.width + kPSMTabBarCellPadding;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// object counter
|
||||
if([cell count] > 0){
|
||||
[[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set];
|
||||
@@ -438,7 +440,7 @@ void MyNSDrawWindowBackground(NSRect rect)
|
||||
counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5;
|
||||
[counterString drawInRect:counterStringRect];
|
||||
}
|
||||
|
||||
|
||||
// label rect
|
||||
NSRect labelRect;
|
||||
labelRect.origin.x = labelPosition;
|
||||
|
||||
@@ -407,7 +407,7 @@
|
||||
[[cell indicator] setHidden:YES];
|
||||
if([item identifier] != nil){
|
||||
if([[item identifier] respondsToSelector:@selector(content)]){
|
||||
if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(isProcessing)]){
|
||||
if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(isProcessing)]){
|
||||
NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
|
||||
[bindingOptions setObject:NSNegateBooleanTransformerName forKey:@"NSValueTransformerName"];
|
||||
[[cell indicator] bind:@"animate" toObject:[item identifier] withKeyPath:@"selection.isProcessing" options:nil];
|
||||
@@ -421,7 +421,7 @@
|
||||
[cell setHasIcon:NO];
|
||||
if([item identifier] != nil){
|
||||
if([[item identifier] respondsToSelector:@selector(content)]){
|
||||
if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(icon)]){
|
||||
if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(icon)]){
|
||||
NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
|
||||
[bindingOptions setObject:NSIsNotNilTransformerName forKey:@"NSValueTransformerName"];
|
||||
[cell bind:@"hasIcon" toObject:[item identifier] withKeyPath:@"selection.icon" options:bindingOptions];
|
||||
@@ -434,7 +434,7 @@
|
||||
[cell setCount:0];
|
||||
if([item identifier] != nil){
|
||||
if([[item identifier] respondsToSelector:@selector(content)]){
|
||||
if([[[[cell representedObject] identifier] content] respondsToSelector:@selector(objectCount)]){
|
||||
if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(objectCount)]){
|
||||
[cell bind:@"count" toObject:[item identifier] withKeyPath:@"selection.objectCount" options:nil];
|
||||
[[item identifier] addObserver:self forKeyPath:@"selection.objectCount" options:0 context:nil];
|
||||
}
|
||||
|
||||
@@ -398,7 +398,8 @@
|
||||
// scoot label over
|
||||
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
|
||||
}
|
||||
|
||||
|
||||
#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best.
|
||||
// icon
|
||||
if([cell hasIcon]){
|
||||
NSRect iconRect = [self iconRectForTabCell:cell];
|
||||
@@ -411,7 +412,8 @@
|
||||
// scoot label over
|
||||
labelPosition += iconRect.size.width + kPSMTabBarCellPadding;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// object counter
|
||||
if([cell count] > 0){
|
||||
[[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set];
|
||||
@@ -433,7 +435,7 @@
|
||||
counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5;
|
||||
[counterString drawInRect:counterStringRect];
|
||||
}
|
||||
|
||||
|
||||
// label rect
|
||||
NSRect labelRect;
|
||||
labelRect.origin.x = labelPosition;
|
||||
|
||||
@@ -1675,14 +1675,14 @@ gui_mch_toggle_tearoffs(int enable)
|
||||
void
|
||||
gui_mch_enter_fullscreen(int fuoptions_flags, guicolor_T bg)
|
||||
{
|
||||
[[MMBackend sharedInstance] enterFullscreen:fuoptions_flags background:bg];
|
||||
[[MMBackend sharedInstance] enterFullScreen:fuoptions_flags background:bg];
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gui_mch_leave_fullscreen()
|
||||
{
|
||||
[[MMBackend sharedInstance] leaveFullscreen];
|
||||
[[MMBackend sharedInstance] leaveFullScreen];
|
||||
}
|
||||
|
||||
|
||||
@@ -1699,7 +1699,7 @@ gui_mch_fuopt_update()
|
||||
bg = fuoptions_bgcolor;
|
||||
}
|
||||
|
||||
[[MMBackend sharedInstance] setFullscreenBackgroundColor:bg];
|
||||
[[MMBackend sharedInstance] setFullScreenBackgroundColor:bg];
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
-1
@@ -1,7 +1,7 @@
|
||||
" System gvimrc file for MacVim
|
||||
"
|
||||
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
|
||||
" Last Change: Sun Aug 29 2009
|
||||
" Last Change: Tue Jul 26 2011
|
||||
"
|
||||
" This is a work in progress. If you feel so inclined, please help me improve
|
||||
" this file.
|
||||
@@ -63,6 +63,10 @@ if !exists("macvim_skip_cmd_opt_movement")
|
||||
|
||||
imap <M-BS> <C-w>
|
||||
imap <D-BS> <C-u>
|
||||
|
||||
" Make the 'delete' key delete selection in visual+select mode instead of
|
||||
" moving cursor to the left.
|
||||
vmap <Backspace> d
|
||||
endif " !exists("macvim_skip_cmd_opt_movement")
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1238,7 +1238,7 @@ static struct vimoption
|
||||
{"fuoptions", "fuopt", P_STRING|P_COMMA|P_NODUP|P_VI_DEF,
|
||||
#ifdef FEAT_FULLSCREEN
|
||||
(char_u *)&p_fuoptions, PV_NONE,
|
||||
{(char_u *)"maxvert", (char_u *)0L}
|
||||
{(char_u *)"maxvert,maxhorz", (char_u *)0L}
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)NULL, (char_u *)0L}
|
||||
|
||||
Reference in New Issue
Block a user