diff options
-rw-r--r-- | content/browser/tab_contents/tab_contents.cc | 7 | ||||
-rw-r--r-- | content/renderer/render_widget.cc | 13 |
2 files changed, 18 insertions, 2 deletions
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index e1cd678..8fc8df5 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -767,6 +767,13 @@ void TabContents::DidBecomeSelected() { last_selected_time_ = base::TimeTicks::Now(); FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidBecomeSelected()); + + // The resize rect might have changed while this was inactive -- send the new + // one to make sure it's up to date. + RenderViewHost* rvh = GetRenderViewHost(); + if (rvh) { + rvh->ResizeRectChanged(GetRootWindowResizerRect()); + } } diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 6584150..90f7431 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -318,9 +318,18 @@ void RenderWidget::OnResize(const gfx::Size& new_size, void RenderWidget::OnChangeResizeRect(const gfx::Rect& resizer_rect) { if (resizer_rect_ != resizer_rect) { - paint_aggregator_.InvalidateRect(resizer_rect_); - paint_aggregator_.InvalidateRect(resizer_rect); + gfx::Rect view_rect(size_); + + gfx::Rect old_damage_rect = view_rect.Intersect(resizer_rect_); + if (!old_damage_rect.IsEmpty()) + paint_aggregator_.InvalidateRect(old_damage_rect); + + gfx::Rect new_damage_rect = view_rect.Intersect(resizer_rect); + if (!new_damage_rect.IsEmpty()) + paint_aggregator_.InvalidateRect(new_damage_rect); + resizer_rect_ = resizer_rect; + if (webwidget_) webwidget_->didChangeWindowResizerRect(); } |