From: andersca@apple.com Date: Wed, 1 Feb 2012 23:54:54 +0000 (+0000) Subject: REGRESSION (r104727): Strange graphics corruption opening a new tab in Safari X-Git-Tag: 070512121124~14003 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=551002e05ea61ae2f24c8f365b0d4bc18248470f;p=profile%2Fivi%2Fwebkit-efl.git REGRESSION (r104727): Strange graphics corruption opening a new tab in Safari https://bugs.webkit.org/show_bug.cgi?id=77578 Reviewed by Dan Bernstein. Resizing a window will always invalidate the window backing store, so make sure to set _data->_windowHasValidBackingStore to NO whenever that happens. * UIProcess/API/mac/WKView.mm: (-[WKView addWindowObserversForWindow:]): Use separate methods for the NSWindowDidMoveNotification and NSWindowDidResizeNotification notifications. (-[WKView _windowDidMove:]): Call -[WKView _updateWindowAndViewFrames]. (-[WKView _windowDidResize:]): Call -[WKView _updateWindowAndViewFrames] and mark the window backing store as invalid. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106508 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 2887506..9334442 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,24 @@ +2012-02-01 Anders Carlsson + + REGRESSION (r104727): Strange graphics corruption opening a new tab in Safari + https://bugs.webkit.org/show_bug.cgi?id=77578 + + + Reviewed by Dan Bernstein. + + Resizing a window will always invalidate the window backing store, so make sure to set + _data->_windowHasValidBackingStore to NO whenever that happens. + + * UIProcess/API/mac/WKView.mm: + (-[WKView addWindowObserversForWindow:]): + Use separate methods for the NSWindowDidMoveNotification and NSWindowDidResizeNotification notifications. + + (-[WKView _windowDidMove:]): + Call -[WKView _updateWindowAndViewFrames]. + + (-[WKView _windowDidResize:]): + Call -[WKView _updateWindowAndViewFrames] and mark the window backing store as invalid. + 2012-02-01 Beth Dakin https://bugs.webkit.org/show_bug.cgi?id=77383 diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm index d8f0854..7d21e9b 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKView.mm +++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm @@ -1776,9 +1776,9 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl name:NSWindowDidMiniaturizeNotification object:window]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowFrameDidChange:) + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidMove:) name:NSWindowDidMoveNotification object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowFrameDidChange:) + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidResize:) name:NSWindowDidResizeNotification object:window]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidOrderOffScreen:) name:@"NSWindowDidOrderOffScreenNotification" object:window]; @@ -1906,8 +1906,15 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl [self _updateWindowVisibility]; } -- (void)_windowFrameDidChange:(NSNotification *)notification +- (void)_windowDidMove:(NSNotification *)notification { + [self _updateWindowAndViewFrames]; +} + +- (void)_windowDidResize:(NSNotification *)notification +{ + _data->_windowHasValidBackingStore = NO; + [self _updateWindowAndViewFrames]; }