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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 300163002: Update window region after widget resizes not changing HWND size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 6 years, 7 months 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 | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6ffeb7e1b19e37c344b227d4d9842a94ce33504d 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -525,13 +525,24 @@ void HWNDMessageHandler::GetWindowPlacement(
}
}
-void HWNDMessageHandler::SetBounds(const gfx::Rect& bounds_in_pixels) {
+void HWNDMessageHandler::SetBounds(const gfx::Rect& bounds_in_pixels,
+ bool force_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, we will not receive standard size change
+ // notifications. If |force_size_changed| is |true|, we should pretend size is
+ // changed.
+ if (old_size == bounds_in_pixels.size() && force_size_changed) {
+ delegate_->HandleClientSizeChanged(GetClientAreaBounds().size());
+ ResetWindowRegion(false, true);
+ }
}
void HWNDMessageHandler::SetSize(const gfx::Size& size) {
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698