+2012-02-01 Anders Carlsson <andersca@apple.com>
+
+ REGRESSION (r104727): Strange graphics corruption opening a new tab in Safari
+ https://bugs.webkit.org/show_bug.cgi?id=77578
+ <rdar://problem/10767174>
+
+ 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 <bdakin@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=77383
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];
[self _updateWindowVisibility];
}
-- (void)_windowFrameDidChange:(NSNotification *)notification
+- (void)_windowDidMove:(NSNotification *)notification
{
+ [self _updateWindowAndViewFrames];
+}
+
+- (void)_windowDidResize:(NSNotification *)notification
+{
+ _data->_windowHasValidBackingStore = NO;
+
[self _updateWindowAndViewFrames];
}