From ad2b2c2c9df001a5398afabd4670369ab1e6d0cd Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sun, 8 Nov 2009 18:59:30 +0100 Subject: [PATCH] Avoid forcing redraw in full-screen Previously the content view in full-screen mode would get redrawn whenever the Vim view possibly changed size. Now the view is only updated if the view did change size (fixes redraw problems with the Core Text renderer). --- src/MacVim/MMWindowController.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 220f0601..11b277a2 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -430,6 +430,7 @@ if (shouldResizeVimView) { shouldResizeVimView = NO; + NSSize originalSize = [vimView frame].size; NSSize contentSize = [vimView desiredSize]; contentSize = [self constrainContentSizeToScreenSize:contentSize]; contentSize = [vimView constrainRows:NULL columns:NULL @@ -437,8 +438,15 @@ [vimView setFrameSize:contentSize]; if (fullscreenEnabled) { - [[fullscreenWindow contentView] setNeedsDisplay:YES]; - [fullscreenWindow centerView]; + // NOTE! Don't mark the fullscreen 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]; + } } else { [self resizeWindowToFitContentSize:contentSize keepOnScreen:keepOnScreen]; -- 2.11.4.GIT