diff options
Diffstat (limited to 'views/widget')
-rwxr-xr-x | views/widget/root_view_gtk.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/views/widget/root_view_gtk.cc b/views/widget/root_view_gtk.cc index 1225efe..6984429 100755 --- a/views/widget/root_view_gtk.cc +++ b/views/widget/root_view_gtk.cc @@ -13,8 +13,19 @@ namespace views { void RootView::OnPaint(GdkEventExpose* event) { - gfx::CanvasPaint canvas(event); + gfx::Rect original_dirty_region = GetScheduledPaintRectConstrainedToSize(); + if (!original_dirty_region.IsEmpty()) { + // Between the the time the paint was scheduled and the time we end + // up painting more SchedulePaints may have been invoked. Expand the + // region Gdk wants us to paint to include the region we want to paint + // to make sure everything is painted. Otherwise we may not paint + // everything we need to. + gfx::Rect complete_area = + original_dirty_region.Union(gfx::Rect(event->area)); + event->area = complete_area.ToGdkRectangle(); + } + gfx::CanvasPaint canvas(event); if (!canvas.is_empty()) { canvas.set_composite_alpha( static_cast<WidgetGtk*>(GetWidget())->is_transparent()); |