diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 17:46:15 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 17:46:15 +0000 |
commit | d4b3a6f00112079f966830cf0f2f3c34a156c10e (patch) | |
tree | d56d53ebe4303fe2ee270375af134066f75b2228 /views/widget | |
parent | 0b32f41d746954cb9c66cb7bfafe118d9f0d1bfd (diff) | |
download | chromium_src-d4b3a6f00112079f966830cf0f2f3c34a156c10e.zip chromium_src-d4b3a6f00112079f966830cf0f2f3c34a156c10e.tar.gz chromium_src-d4b3a6f00112079f966830cf0f2f3c34a156c10e.tar.bz2 |
Fix recursive calls to PaintNow under gtk2.18.3 and up.
gdk_window_process_updates in gtk2.18.3 issues exposure events on its child gdkwindow (with update_children=true) and drives event loop. In current implementation, WidgetGtk::DidProcessEvent calls PaintNow no matter where the event was generated to, which causes recursive calls to PaintNow. This cl fix this issue by calling PaintNow only when the event was for the target WidgetGtk.
BUG=42235
TEST=none
Review URL: http://codereview.chromium.org/1741004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/widget_gtk.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index cb54356..cec72fd 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -733,7 +733,14 @@ void WidgetGtk::WillProcessEvent(GdkEvent* event) { } void WidgetGtk::DidProcessEvent(GdkEvent* event) { - if (root_view_->NeedsPainting(true)) + // Under gtk 2.18.6 (also observed in 2.18.3), gdk_window_process_updates() + // ued in PaintNow() method may issue another exposure event and drive + // nested message loop, which causes recursive call to PaintNow on the same + // WidgetGtk instance. + // Invoke PaintNow only if the event is originated from this WidgetGtk's + // window_contents_. See bug://crbug.com/42235 for details. + if (window_contents_ && event->any.window == window_contents_->window && + root_view_->NeedsPainting(true)) PaintNow(root_view_->GetScheduledPaintRect()); } |