Index: ui/views/win/hwnd_message_handler.cc |
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc |
index ca66913aa0741f39d5914a20b526f9a81528f71d..4c93b605218ce693ac1a223c5f62c1a34d8ae6dd 100644 |
--- a/ui/views/win/hwnd_message_handler.cc |
+++ b/ui/views/win/hwnd_message_handler.cc |
@@ -525,13 +525,23 @@ void HWNDMessageHandler::GetWindowPlacement( |
} |
} |
-void HWNDMessageHandler::SetBounds(const gfx::Rect& bounds_in_pixels) { |
+void HWNDMessageHandler::SetBounds(const gfx::Rect& bounds_in_pixels, |
+ bool widget_size_changed) { |
LONG style = GetWindowLong(hwnd(), GWL_STYLE); |
if (style & WS_MAXIMIZE) |
SetWindowLong(hwnd(), GWL_STYLE, style & ~WS_MAXIMIZE); |
+ |
+ gfx::Size old_size = GetClientAreaBounds().size(); |
SetWindowPos(hwnd(), NULL, bounds_in_pixels.x(), bounds_in_pixels.y(), |
bounds_in_pixels.width(), bounds_in_pixels.height(), |
SWP_NOACTIVATE | SWP_NOZORDER); |
+ // If HWND size is not changed, but the actual size of widget is changed, |
+ // we'll not receive standard size change notifications; so, we should update |
+ // manually. |
+ if (old_size == bounds_in_pixels.size() && widget_size_changed) { |
+ delegate_->HandleClientSizeChanged(GetClientAreaBounds().size()); |
+ ResetWindowRegion(false, true); |
+ } |
} |
void HWNDMessageHandler::SetSize(const gfx::Size& size) { |