Chromium Code Reviews| Index: chrome/browser/renderer_host/render_widget_host_view_win.cc |
| 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 45714a27d26282d6bb83bc7d74235d50238e1ebf..0ce2aadc728d9db3aa7c6f39e044b166815792e1 100644 |
| --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc |
| +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc |
| @@ -366,19 +366,28 @@ void RenderWidgetHostViewWin::WasHidden() { |
| } |
| void RenderWidgetHostViewWin::SetSize(const gfx::Size& size) { |
| + SetBounds(gfx::Rect(GetViewBounds.origin(), size)); |
| +} |
| + |
| +void RenderWidgetHostViewWin::SetBounds(const gfx::Rect& rect) { |
| if (is_hidden_) |
| return; |
| - // No SWP_NOREDRAW as autofill popups can resize and the underneath window |
| + // No SWP_NOREDRAW as autofill popups can move and the underneath window |
| // should redraw in that case. |
| UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | |
| - SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; |
| - SetWindowPos(NULL, 0, 0, size.width(), size.height(), swp_flags); |
| + SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; |
| + |
| + // If the style is not popup, you have to convert the point to client |
|
Peter Kasting
2011/03/07 19:25:44
The MSDN docs for SetWindowPos() say that the supp
honten.org
2011/03/07 19:36:07
Yes, I thought so first. But it caused the problem
Peter Kasting
2011/03/07 20:20:15
That sounds like a bug in ScreenToClient(), maybe.
honten.org
2011/03/07 21:19:50
Ok, I ask Ben.
On 2011/03/07 20:20:15, Peter Kast
Ben Goodger (Google)
2011/03/09 02:30:32
Peter is right, this should check for !GetParent(G
honten.org
2011/03/09 02:33:03
I see.
So, for now, if WS_POPUP is specified, WS_
honten.org
2011/03/10 05:55:48
Ben,
Unfortunately, this is not right. Even if I
|
| + // coordinate. |
| + CPoint point(rect.x(), rect.y()); |
| + if (!(GetStyle() & WS_POPUP)) |
| + ScreenToClient(&point); |
| + |
| + SetWindowPos(NULL, point.x, point.y, rect.width(), rect.height(), swp_flags); |
| if (compositor_host_window_) { |
| - ::SetWindowPos(compositor_host_window_, |
| - NULL, |
| - 0, 0, |
| - size.width(), size.height(), |
| + ::SetWindowPos(compositor_host_window_, NULL, point.x, point.y, |
| + rect.width(), rect.height(), |
| SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE); |
| } |
| render_widget_host_->WasResized(); |