Skip to content
Snippets Groups Projects
Commit ebc2c46f authored by George Nachman's avatar George Nachman
Browse files

Respect vertical only for zooming. Fix some bugs in previous attempt.

parent 6d8f6f74
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -51,6 +51,9 @@
 
// True if in OS 10.7 fullscreen mode.
BOOL isFullScreen_;
// True while in -[NSWindow toggleFullScreen:].
BOOL isTogglingLionFullScreen_;
}
 
- initWithContentRect:(NSRect)contentRect
Loading
Loading
Loading
Loading
@@ -132,7 +132,14 @@
// This is a way of calling [super toggleFullScreen:] that doesn't give a warning if
// the method doesn't exist (it's new in 10.7) but we build against 10.5 sdk.
IMP functionPointer = [NSWindow instanceMethodForSelector:_cmd];
isTogglingLionFullScreen_ = true;
functionPointer(self, _cmd, sender);
isTogglingLionFullScreen_ = false;
}
- (BOOL)isTogglingLionFullScreen
{
return isTogglingLionFullScreen_;
}
 
- (BOOL)isFullScreen
Loading
Loading
Loading
Loading
@@ -1556,22 +1556,18 @@ NSString *sessionsKey = @"sessions";
BOOL verticalOnly = NO;
 
BOOL maxVerticallyPref;
if ([self lionFullScreen] ||
(windowType_ != WINDOW_TYPE_FULL_SCREEN &&
IsLionOrLater() &&
[[PreferencePanel sharedInstance] lionStyleFullscreen])) {
if ([[self ptyWindow] isTogglingLionFullScreen]) {
// Going into lion fullscreen mode. Disregard the "maximize vertically"
// preference (though it can still be overridden with the shift key,
// below.
maxVerticallyPref = NO;
// preference.
verticalOnly = NO;
} else {
maxVerticallyPref = [[PreferencePanel sharedInstance] maxVertically];
if (maxVerticallyPref ^
(([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask) != 0)) {
verticalOnly = YES;
}
}
 
if (maxVerticallyPref ^
(([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask) != 0)) {
verticalOnly = YES;
}
if (verticalOnly) {
// Keep the width the same
proposedFrame.size.width = [sender frame].size.width;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment