diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 01:43:49 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 01:43:49 +0000 |
commit | 525f9f6d6eab948d11f8a55422ee0e7a352a768d (patch) | |
tree | 8535abe850265913281f1de74ebd145d342b8bd4 /chrome | |
parent | 2181ea006830c226a8a3c21aa17030a01ec62a5e (diff) | |
download | chromium_src-525f9f6d6eab948d11f8a55422ee0e7a352a768d.zip chromium_src-525f9f6d6eab948d11f8a55422ee0e7a352a768d.tar.gz chromium_src-525f9f6d6eab948d11f8a55422ee0e7a352a768d.tar.bz2 |
Don't call NPP_SetWindow before we have the plugin geometry.
Note: the full fix to the bug also needs Ananta's change at http://codereview.chromium.org/119200
Bug=12993
Review URL: http://codereview.chromium.org/118359
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17920 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_win.cc | 23 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 4 |
2 files changed, 18 insertions, 9 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index 6f2f835..c786e70 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -338,15 +338,20 @@ void RenderWidgetHostViewWin::MovePluginWindows( else flags |= SWP_HIDEWINDOW; - HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(), - move.clip_rect.y(), - move.clip_rect.right(), - move.clip_rect.bottom()); - gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects); - - // Note: System will own the hrgn after we call SetWindowRgn, - // so we don't need to call DeleteObject(hrgn) - ::SetWindowRgn(window, hrgn, !move.clip_rect.IsEmpty()); + if (move.rects_valid) { + HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(), + move.clip_rect.y(), + move.clip_rect.right(), + move.clip_rect.bottom()); + gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects); + + // Note: System will own the hrgn after we call SetWindowRgn, + // so we don't need to call DeleteObject(hrgn) + ::SetWindowRgn(window, hrgn, !move.clip_rect.IsEmpty()); + } else { + flags |= SWP_NOMOVE; + flags |= SWP_NOSIZE; + } defer_window_pos_info = ::DeferWindowPos(defer_window_pos_info, window, NULL, diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 4f10abf..50749cb 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -936,6 +936,7 @@ struct ParamTraits<WebPluginGeometry> { WriteParam(m, p.window_rect); WriteParam(m, p.clip_rect); WriteParam(m, p.cutout_rects); + WriteParam(m, p.rects_valid); WriteParam(m, p.visible); } static bool Read(const Message* m, void** iter, param_type* p) { @@ -944,6 +945,7 @@ struct ParamTraits<WebPluginGeometry> { ReadParam(m, iter, &p->window_rect) && ReadParam(m, iter, &p->clip_rect) && ReadParam(m, iter, &p->cutout_rects) && + ReadParam(m, iter, &p->rects_valid) && ReadParam(m, iter, &p->visible); } static void Log(const param_type& p, std::wstring* l) { @@ -956,6 +958,8 @@ struct ParamTraits<WebPluginGeometry> { l->append(L", "); LogParam(p.cutout_rects, l); l->append(L", "); + LogParam(p.rects_valid, l); + l->append(L", "); LogParam(p.visible, l); l->append(L")"); } |