From c836ac1c37378cc57e670db271f892abaec5db8e Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Mon, 5 Jul 2010 18:22:22 +0200 Subject: [PATCH] Fix restore of window dim when leaving full screen Restore the window dimensions when leaving full screen even if the view size changed a little bit during full screen mode. This way the window dimensions are restored even if tabline or scrollbars were toggled during full screen. --- src/MacVim/MMFullscreenWindow.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/MacVim/MMFullscreenWindow.m b/src/MacVim/MMFullscreenWindow.m index 6631c861c7..21f9fb8f66 100644 --- a/src/MacVim/MMFullscreenWindow.m +++ b/src/MacVim/MMFullscreenWindow.m @@ -230,14 +230,16 @@ [[view textView] getMaxRows:&currRows columns:&currColumns]; int newRows = currRows, newColumns = currColumns; - // compute desired non-fu size. - // if current fu size is equal to fu size at fu enter time, - // restore the old size + // Compute desired non-fu size. // - if (startFuFlags & FUOPT_MAXVERT && startFuRows == currRows) + // 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 && startFuColumns == currColumns) + if (startFuFlags & FUOPT_MAXHORZ && abs(startFuColumns-currColumns)<5) newColumns = nonFuColumns; // resize vim if necessary