summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_win.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_win.cc b/webkit/glue/plugins/webplugin_delegate_impl_win.cc
index 9cdc7db..8c88680 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_win.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl_win.cc
@@ -1020,6 +1020,8 @@ void WebPluginDelegateImpl::WindowlessPaint(HDC hdc,
damage_rect_win.right = damage_rect_win.left + damage_rect.width();
damage_rect_win.bottom = damage_rect_win.top + damage_rect.height();
+ // Save away the old HDC as this could be a nested invocation.
+ void* old_dc = window_.window;
window_.window = hdc;
NPEvent paint_event;
@@ -1030,6 +1032,7 @@ void WebPluginDelegateImpl::WindowlessPaint(HDC hdc,
static StatsRate plugin_paint("Plugin.Paint");
StatsScope<StatsRate> scope(plugin_paint);
instance()->NPP_HandleEvent(&paint_event);
+ window_.window = old_dc;
}
void WebPluginDelegateImpl::WindowlessSetWindow() {