From 542c5fbedcba5bccd92b1b3bd9ed6dd6457cebea Mon Sep 17 00:00:00 2001 From: Robert Grant Date: Thu, 26 May 2011 13:59:47 -0400 Subject: [PATCH] Cut down the amount of redrawing when simply moving the window around --- AppKit/NSWindow.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/AppKit/NSWindow.m b/AppKit/NSWindow.m index b0d9cc96..0c2206cd 100755 --- a/AppKit/NSWindow.m +++ b/AppKit/NSWindow.m @@ -2591,11 +2591,16 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification [_childWindows makeObjectsPerformSelector:@selector(_parentWindowDidChangeFrame:) withObject:self]; [_drawers makeObjectsPerformSelector:@selector(parentWindowDidChangeFrame:) withObject:self]; - [_backgroundView setFrameSize:_frame.size]; - [_backgroundView setNeedsDisplay:YES]; + if (didSize) { + // Don't redraw everything unless we really have to + [_backgroundView setFrameSize:_frame.size]; + [_backgroundView setNeedsDisplay:YES]; + + // And make sure the cursor rect align with the new size + [self resetCursorRects]; + } [self saveFrameUsingName:_autosaveFrameName]; - [self resetCursorRects]; if(didSize){ [self postNotificationName:NSWindowDidResizeNotification];