Merge pull request #1170 from ychin/fix-non-native-fullscreen-sizing-fuopts

Fix non-native full screen sizing, fix 'fuoptions', allow menus
This commit is contained in:
Yee Cheng Chin
2021-02-04 11:43:04 -08:00
committed by GitHub
10 changed files with 132 additions and 157 deletions
+1
View File
@@ -263,6 +263,7 @@ KEY VALUE ~
*MMLoginShellArgument* login shell parameter [string]
*MMLoginShellCommand* which shell to use to launch Vim [string]
*MMNativeFullScreen* use native full screen mode [bool]
*MMNonNativeFullScreenShowMenu* show menus when in non-native full screen [bool]
*MMNoFontSubstitution* disable automatic font substitution [bool]
(Deprecated: Non-CoreText renderer only)
*MMFontPreserveLineSpacing* use the line-spacing as specified by font [bool]
+9 -20
View File
@@ -3607,23 +3607,19 @@ A jump table for the options with a short description can be found at |Q_op|.
global
{not in Vi}
{only in MacVim GUI}
In fullscreen mode, most of the screen is black, only a part of the
screen is covered by the actual Vim control. The control is centered.
This option controls the size of the Vim control as well as the color
of the unused screen area.
{not supported in native full screen mode}
In non-native fullscreen mode, MacVim can be configured to either show
all the content filling up the whole screen, or only use part of the
screen to show the content, centered. This option controls the size
of the Vim control as well as the color of the unused screen area.
value effect ~
maxvert When entering fullscreen, 'lines' is set to the maximum number
of lines fitting on the screen in fullscreen mode. When
leaving fullscreen, if 'lines' is still equal to the maximized
number of lines, it is restored to the value it had before
entering fullscreen.
of lines fitting on the screen in fullscreen mode. If unset,
'lines' will be unchanged when entering fullscreen mode.
maxhorz When entering fullscreen, 'columns' is set to the maximum number
of columns fitting on the screen in fullscreen mode. When
leaving fullscreen, if 'columns' is still equal to the maximized
number of columns, it is restored to the value it had before
entering fullscreen.
of columns fitting on the screen in fullscreen mode. If unset,
'columns' will be unchanged when entering fullscreen mode.
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 '#',
@@ -3645,13 +3641,6 @@ A jump table for the options with a short description can be found at |Q_op|.
< 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
restore the old 'lines' or 'columns' in that case.
XXX: Each time the Vim window resizes (for example due to font size
changes, re-maximize Vim to fullscreen?)
XXX: The approach doesn't restore vertical Vim size if fu is entered
without tabs and leaves with tabs (or the other way round).
+1
View File
@@ -5030,6 +5030,7 @@ MMLoginShellCommand gui_mac.txt /*MMLoginShellCommand*
MMNativeFullScreen gui_mac.txt /*MMNativeFullScreen*
MMNoFontSubstitution gui_mac.txt /*MMNoFontSubstitution*
MMNoTitleBarWindow gui_mac.txt /*MMNoTitleBarWindow*
MMNonNativeFullScreenShowMenu gui_mac.txt /*MMNonNativeFullScreenShowMenu*
MMShareFindPboard gui_mac.txt /*MMShareFindPboard*
MMShowAddTabButton gui_mac.txt /*MMShowAddTabButton*
MMTabMaxWidth gui_mac.txt /*MMTabMaxWidth*
+67 -42
View File
@@ -227,11 +227,11 @@
<point key="canvasLocation" x="138" y="20"/>
</customView>
<customView id="hr4-G4-3ZG" userLabel="Appearance">
<rect key="frame" x="0.0" y="0.0" width="483" height="270"/>
<rect key="frame" x="0.0" y="0.0" width="483" height="315"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<customView id="fw0-VK-Nbz" userLabel="Dark mode selection">
<rect key="frame" x="19" y="92" width="433" height="156"/>
<rect key="frame" x="19" y="137" width="433" height="156"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="T40-Os-PUf" userLabel="Dark mode selection">
@@ -292,7 +292,7 @@
</subviews>
</customView>
<customView id="7af-iK-4r7" userLabel="Titlebar appearance">
<rect key="frame" x="19" y="46" width="433" height="38"/>
<rect key="frame" x="19" y="91" width="433" height="38"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button id="7ie-0J-0Zr">
@@ -330,27 +330,73 @@
</button>
</subviews>
</customView>
<customView id="BpJ-rH-ona" userLabel="Font">
<rect key="frame" x="19" y="20" width="433" height="18"/>
<customView id="BpJ-rH-ona" userLabel="Full Screen">
<rect key="frame" x="19" y="45" width="433" height="38"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button id="YKV-u2-Egc" userLabel="Preserve Line Spacing">
<rect key="frame" x="189" y="-1" width="244" height="18"/>
<button toolTip="Use macOS's native full screen mode, which integrates with Mission Control and creates a new Space for the window." id="YKV-u2-Egc" userLabel="Use native full screen">
<rect key="frame" x="189" y="19" width="244" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<string key="toolTip">Some fonts have non-standard built-in line spacings (anything other than 1). If this is checked, MacVim will use the font's specified line spacing to calculate line height. Otherwise, it will just set it to 1, which helps if you would like a more compact spacing without having to install another font.</string>
<buttonCell key="cell" type="check" title="Preserve font line spacing" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="2ni-Is-Caz" userLabel="Preserve Line Spacing">
<buttonCell key="cell" type="check" title="Use native full screen mode" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="2ni-Is-Caz" userLabel="Use native full screen">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="fontPropertiesChanged:" target="-2" id="uaN-zX-Lvq"/>
<binding destination="58" name="value" keyPath="values.MMFontPreserveLineSpacing" id="i6W-kG-7G5"/>
<binding destination="58" name="value" keyPath="values.MMNativeFullScreen" id="Y8t-au-n4b"/>
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="VAj-Yx-2uZ" userLabel="Font">
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="VAj-Yx-2uZ" userLabel="Full Sc">
<rect key="frame" x="-2" y="20" width="187" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Full Screen:" id="bMQ-uG-iDR">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="Fru-Q7-7SG" userLabel="Non-native menu bar">
<rect key="frame" x="189" y="2" width="237" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Show menu bar in non-native mode" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="Kok-Et-R5A" userLabel="Show menu bar in non-native full screen">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
<connections>
<binding destination="58" name="enabled" keyPath="values.MMNativeFullScreen" id="Uw8-jM-9g1">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
</connections>
</buttonCell>
<connections>
<action selector="fontPropertiesChanged:" target="-2" id="1RM-UT-GNp"/>
<binding destination="58" name="value" keyPath="values.MMNonNativeFullScreenShowMenu" id="5wX-jg-QPo"/>
</connections>
</button>
</subviews>
</customView>
<customView id="a3v-cB-TFa" userLabel="Font">
<rect key="frame" x="19" y="20" width="433" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button id="A48-s0-kdR" userLabel="Preserve Line Spacing">
<rect key="frame" x="189" y="-1" width="244" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<string key="toolTip">Some fonts have non-standard built-in line spacings (anything other than 1). If this is checked, MacVim will use the font's specified line spacing to calculate line height. Otherwise, it will just set it to 1, which helps if you would like a more compact spacing without having to install another font.</string>
<buttonCell key="cell" type="check" title="Preserve font line spacing" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="SeR-yl-Gtz" userLabel="Preserve Line Spacing">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="fontPropertiesChanged:" target="-2" id="tbK-S9-Vbs"/>
<binding destination="58" name="value" keyPath="values.MMFontPreserveLineSpacing" id="6cJ-Uj-qVy"/>
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="8WW-zu-LlE" userLabel="Font">
<rect key="frame" x="-2" y="0.0" width="187" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Font:" id="bMQ-uG-iDR">
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Font:" id="eV4-3c-P2e">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
@@ -359,14 +405,14 @@
</subviews>
</customView>
</subviews>
<point key="canvasLocation" x="138" y="390"/>
<point key="canvasLocation" x="137.5" y="412.5"/>
</customView>
<customView id="620" userLabel="Advanced">
<rect key="frame" x="0.0" y="0.0" width="483" height="318"/>
<rect key="frame" x="0.0" y="0.0" width="483" height="264"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="826">
<rect key="frame" x="17" y="170" width="449" height="56"/>
<rect key="frame" x="17" y="116" width="449" height="56"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" id="993">
<font key="font" metaFont="smallSystem"/>
@@ -376,7 +422,7 @@
</textFieldCell>
</textField>
<button id="817">
<rect key="frame" x="18" y="228" width="133" height="18"/>
<rect key="frame" x="18" y="174" width="133" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Enable Quickstart" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="992">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -388,7 +434,7 @@
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="815">
<rect key="frame" x="17" y="252" width="449" height="28"/>
<rect key="frame" x="17" y="198" width="449" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="(Deprecated) Deselect this option to use the legacy renderer, which is unsupported and will be removed in a future version." id="991">
<font key="font" metaFont="smallSystem"/>
@@ -397,7 +443,7 @@
</textFieldCell>
</textField>
<button id="782">
<rect key="frame" x="18" y="282" width="174" height="18"/>
<rect key="frame" x="18" y="228" width="174" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Use Core Text renderer" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="990">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -409,7 +455,7 @@
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="1001">
<rect key="frame" x="17" y="74" width="444" height="70"/>
<rect key="frame" x="17" y="20" width="444" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" id="1004">
<font key="font" metaFont="smallSystem"/>
@@ -419,7 +465,7 @@
</textFieldCell>
</textField>
<button id="1013">
<rect key="frame" x="18" y="146" width="174" height="18"/>
<rect key="frame" x="18" y="92" width="174" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Draw marked text inline" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="1014">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -429,29 +475,8 @@
<binding destination="58" name="value" keyPath="values.MMUseInlineIm" id="1016"/>
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="1017">
<rect key="frame" x="17" y="20" width="415" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" id="1020">
<font key="font" metaFont="smallSystem"/>
<string key="title">You may want to disable this option when using multiple monitors since the native full-screen support renders secondary monitors useless.</string>
<color key="textColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="1028">
<rect key="frame" x="18" y="50" width="388" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Prefer native full-screen support (requires Mac OS X 10.7)" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="1029">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="58" name="value" keyPath="values.MMNativeFullScreen" id="1031"/>
</connections>
</button>
</subviews>
<point key="canvasLocation" x="138" y="770"/>
<point key="canvasLocation" x="137.5" y="743"/>
</customView>
</objects>
</document>
+1
View File
@@ -249,6 +249,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[NSNumber numberWithBool:NO], MMSuppressTerminationAlertKey,
[NSNumber numberWithBool:YES], MMNativeFullScreenKey,
[NSNumber numberWithDouble:0.25], MMFullScreenFadeTimeKey,
[NSNumber numberWithBool:NO], MMNonNativeFullScreenShowMenuKey,
[NSNumber numberWithBool:YES], MMShareFindPboardKey,
nil];
+3 -3
View File
@@ -25,8 +25,8 @@
// 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
int startFuRows, startFuColumns;
/// The non-full-screen size of the Vim view. Used for non-maxvert/maxhorz options.
NSSize nonFuVimViewSize;
// This stores the contents of fuoptions_flags at fu start time
int startFuFlags;
@@ -41,7 +41,7 @@
- (void)setOptions:(int)opt;
- (void)enterFullScreen;
- (void)leaveFullScreen;
- (void)centerView;
- (NSRect)getDesiredFrame;
- (BOOL)canBecomeKeyWindow;
- (BOOL)canBecomeMainWindow;
+36 -91
View File
@@ -50,7 +50,6 @@ enum {
- (void)windowDidBecomeMain:(NSNotification *)notification;
- (void)windowDidResignMain:(NSNotification *)notification;
- (void)windowDidMove:(NSNotification *)notification;
- (void)resizeVimView;
@end
@implementation MMFullScreenWindow
@@ -140,7 +139,11 @@ enum {
// Hide Dock and menu bar when going to full screen. Only do so if the current screen
// has a menu bar and dock.
if ([self screenHasDockAndMenu]) {
[NSApplication sharedApplication].presentationOptions =
const bool showMenu = [[NSUserDefaults standardUserDefaults]
boolForKey:MMNonNativeFullScreenShowMenuKey];
[NSApplication sharedApplication].presentationOptions = showMenu ?
NSApplicationPresentationAutoHideDock :
NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar;
}
@@ -198,7 +201,7 @@ enum {
// Store view dimension used before entering full-screen, then resize the
// view to match 'fuopt'.
[[view textView] getMaxRows:&nonFuRows columns:&nonFuColumns];
[self resizeVimView];
nonFuVimViewSize = view.frame.size;
// Store options used when entering full-screen so that we can restore
// dimensions when exiting full-screen.
@@ -244,19 +247,7 @@ enum {
// restore old vim view size
int currRows, currColumns;
[[view textView] getMaxRows:&currRows columns:&currColumns];
int newRows = currRows, newColumns = currColumns;
// Compute desired non-fu size.
//
// If current fu size is almost equal to fu size at fu enter time,
// restore the old size. Don't check for sizes to match exactly since then
// the non-fu size will not be restored if e.g. the tabline or scrollbars
// were toggled while in fu-mode.
if (startFuFlags & FUOPT_MAXVERT && abs(startFuRows-currRows)<5)
newRows = nonFuRows;
if (startFuFlags & FUOPT_MAXHORZ && abs(startFuColumns-currColumns)<5)
newColumns = nonFuColumns;
int newRows = nonFuRows, newColumns = nonFuColumns;
// resize vim if necessary
if (currRows != newRows || currColumns != newColumns) {
@@ -379,29 +370,39 @@ enum {
// 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];
}
/// Get the view vertical offset to allow us space to show the menu bar and what not.
- (CGFloat) viewOffset {
CGFloat menuBarHeight = 0;
if([self screen] != [[NSScreen screens] objectAtIndex:0]) {
// Screens other than the primary screen will not hide their menu bar, adjust the visible view down by the menu height
menuBarHeight = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]-1;
if ([[NSUserDefaults standardUserDefaults]
boolForKey:MMNonNativeFullScreenShowMenuKey]) {
return [[[NSApplication sharedApplication] mainMenu] menuBarHeight]-1;
} else {
return 0;
}
return menuBarHeight;
}
- (void)centerView
/// Returns the desired frame of the Vim view, which takes fuopts into account
/// by centering the view in the middle of the full-screen frame. If using the
/// default of having both maxvert/maxhorz set, this will simply return
/// desiredFrameSize back.
///
/// @return Desired frame, including size and offset.
- (NSRect)getDesiredFrame;
{
NSRect outer = [self frame], inner = [view frame];
NSRect windowFrame = [self frame];
NSSize desiredFrameSize = windowFrame.size;
desiredFrameSize.height -= [self viewOffset];
// NOTE! Make sure the origin coordinates are integral or very strange
// rendering issues may arise (screen looks blurry, each redraw clears the
// entire window, etc.).
NSPoint origin = { floor((outer.size.width - inner.size.width)/2),
floor((outer.size.height - inner.size.height)/2 - [self viewOffset]/2) };
if (!(options & FUOPT_MAXVERT))
desiredFrameSize.height = MIN(desiredFrameSize.height, nonFuVimViewSize.height);
if (!(options & FUOPT_MAXHORZ))
desiredFrameSize.width = MIN(desiredFrameSize.width, nonFuVimViewSize.width);
[view setFrameOrigin:origin];
NSPoint origin = { floor((windowFrame.size.width - desiredFrameSize.width)/2),
floor((windowFrame.size.height - desiredFrameSize.height)/2 - [self viewOffset] / 2) };
return NSMakeRect(origin.x, origin.y, desiredFrameSize.width, desiredFrameSize.height);
}
- (void)scrollWheel:(NSEvent *)theEvent
@@ -462,7 +463,11 @@ enum {
{
// Hide menu and dock when this window gets focus.
if ([self screenHasDockAndMenu]) {
[NSApplication sharedApplication].presentationOptions =
const bool showMenu = [[NSUserDefaults standardUserDefaults]
boolForKey:MMNonNativeFullScreenShowMenuKey];
[NSApplication sharedApplication].presentationOptions = showMenu ?
NSApplicationPresentationAutoHideDock :
NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar;
}
}
@@ -489,66 +494,6 @@ enum {
// 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)resizeVimView
{
// Resize vim view according to options
int currRows, currColumns;
[[view textView] getMaxRows:&currRows columns:&currColumns];
int fuRows = currRows, fuColumns = currColumns;
// NOTE: Do not use [NSScreen visibleFrame] when determining the screen
// size since it compensates for menu and dock.
int maxRows, maxColumns;
NSSize size = [[self screen] frame].size;
size.height -= [self viewOffset];
[view constrainRows:&maxRows columns:&maxColumns toSize:size];
// Compute current fu size
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 windowController] vimController];
[vc sendMessage:msgid data:data];
[[view textView] setMaxRows:fuRows columns:fuColumns];
}
// 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
// a screen that later was unplugged.
startFuRows = fuRows;
startFuColumns = fuColumns;
[self centerView];
}
@end // MMFullScreenWindow (Private)
+12 -1
View File
@@ -785,7 +785,18 @@
keepOnScreen:keepOnScreen];
}
else {
NSSize frameSize = fullScreenWindow ? [fullScreenWindow frame].size : (fullScreenEnabled ? desiredWindowSize : originalSize);
NSSize frameSize;
if (fullScreenWindow) {
// Non-native full screen mode.
NSRect desiredFrame = [fullScreenWindow getDesiredFrame];
frameSize = desiredFrame.size;
[vimView setFrameOrigin:desiredFrame.origin]; // This will get set back to normal in MMFullScreenWindow::leaveFullScreen.
} else if (fullScreenEnabled) {
// Native full screen mode.
frameSize = desiredWindowSize;
} else {
frameSize = originalSize;
}
[vimView setFrameSizeKeepGUISize:frameSize];
}
}
+1
View File
@@ -56,6 +56,7 @@ extern NSString *MMSuppressTerminationAlertKey;
extern NSString *MMNativeFullScreenKey;
extern NSString *MMUseMouseTimeKey;
extern NSString *MMFullScreenFadeTimeKey;
extern NSString *MMNonNativeFullScreenShowMenuKey;
// Enum for MMUntitledWindowKey
+1
View File
@@ -52,6 +52,7 @@ NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
NSString *MMNativeFullScreenKey = @"MMNativeFullScreen";
NSString *MMUseMouseTimeKey = @"MMUseMouseTime";
NSString *MMFullScreenFadeTimeKey = @"MMFullScreenFadeTime";
NSString *MMNonNativeFullScreenShowMenuKey = @"MMNonNativeFullScreenShowMenu";