Fix full-screen zooming with Dock visible

This fixes a bug where 'set fu=maxvert' would not cover the screen
vertically if the Dock was visible.
This commit is contained in:
Bjorn Winckler
2009-03-16 17:36:05 +01:00
parent 2e024248fa
commit 25306ee0c5
2 changed files with 13 additions and 2 deletions
+3 -1
View File
@@ -149,8 +149,10 @@
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] visibleFrame].size;
NSSize size = [[self screen] frame].size;
[view constrainRows:&maxRows columns:&maxColumns toSize:size];
// Store current pre-fu vim size
+10 -1
View File
@@ -780,6 +780,8 @@
// change at any time (dock could move, resolution could change, window
// could be moved to another screen, ...).
// NOTE: Not called in full-screen mode so use "visibleFrame" instead of
// "frame".
NSRect maxFrame = [self constrainFrame:[[win screen] visibleFrame]];
if (proposedFrameSize.width > maxFrame.size.width)
@@ -897,6 +899,8 @@
NSRect newFrame = [decoratedWindow frameRectForContentRect:contentRect];
// Ensure that the window fits inside the visible part of the screen.
// NOTE: Not called in full-screen mode so use "visisbleFrame' instead of
// "frame".
NSRect maxFrame = [[decoratedWindow screen] visibleFrame];
maxFrame = [self constrainFrame:maxFrame];
@@ -921,8 +925,13 @@
- (NSSize)constrainContentSizeToScreenSize:(NSSize)contentSize
{
// 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.
NSWindow *win = [self window];
NSRect rect = [win contentRectForFrameRect:[[win screen] visibleFrame]];
NSRect screenRect = fullscreenEnabled ? [[win screen] frame]
: [[win screen] visibleFrame];
NSRect rect = [win contentRectForFrameRect:screenRect];
if (contentSize.height > rect.size.height)
contentSize.height = rect.size.height;