Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1478)

Unified Diff: webkit/tools/test_shell/webwidget_host_gtk.cc

Issue 11371: Fix infinite paint loop on Linux. (Closed)
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/webwidget_host_gtk.cc
diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc
index b62f912f5c67b7e0d67b36b1236bfb9144644d40..d9769381c9f640d79d98b51e2adcdd97df3fdd2c 100644
--- a/webkit/tools/test_shell/webwidget_host_gtk.cc
+++ b/webkit/tools/test_shell/webwidget_host_gtk.cc
@@ -16,6 +16,8 @@
namespace {
+bool handling_expose = false;
+
// -----------------------------------------------------------------------------
// Callback functions to proxy to host...
@@ -27,9 +29,11 @@ gboolean ConfigureEvent(GtkWidget* widget, GdkEventConfigure* config,
gboolean ExposeEvent(GtkWidget* widget, GdkEventExpose* expose,
WebWidgetHost* host) {
+ handling_expose = true;
gfx::Rect rect(expose->area);
host->UpdatePaintRect(rect);
host->Paint();
+ handling_expose = false;
return FALSE;
}
@@ -155,8 +159,10 @@ void WebWidgetHost::DidInvalidateRect(const gfx::Rect& damaged_rect) {
UpdatePaintRect(damaged_rect);
- gtk_widget_queue_draw_area(GTK_WIDGET(view_), damaged_rect.x(),
- damaged_rect.y(), damaged_rect.width(), damaged_rect.height());
+ if (!handling_expose) {
+ gtk_widget_queue_draw_area(GTK_WIDGET(view_), damaged_rect.x(),
+ damaged_rect.y(), damaged_rect.width(), damaged_rect.height());
+ }
}
void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698