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

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

Issue 243173005: Add SM_CXSIZEFRAME and SM_CXPADDEDBORDER metrics to get window border size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc ('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 a647d207b25dca2da5478d8b368a2b15588c0b74..89945efc66c39eacd4e5d175cd0afea8150d3ac9 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1089,7 +1089,8 @@ bool HWNDMessageHandler::GetClientAreaInsets(gfx::Insets* insets) const {
if (IsMaximized()) {
// Windows automatically adds a standard width border to all sides when a
// window is maximized.
- int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME);
+ int border_thickness =
+ GetSystemMetrics(SM_CXSIZEFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
if (remove_standard_frame_)
border_thickness -= 1;
*insets = gfx::Insets(
@@ -1757,8 +1758,10 @@ LRESULT HWNDMessageHandler::OnNCHitTest(const gfx::Point& point) {
// the vertical scrollar down arrow would be drawn.
// We check if the hittest coordinates lie in this region and if yes
// we return HTCLIENT.
- int border_width = ::GetSystemMetrics(SM_CXSIZEFRAME);
- int border_height = ::GetSystemMetrics(SM_CYSIZEFRAME);
+ int border_width = ::GetSystemMetrics(SM_CXSIZEFRAME) +
+ GetSystemMetrics(SM_CXPADDEDBORDER);
+ int border_height = ::GetSystemMetrics(SM_CYSIZEFRAME) +
+ GetSystemMetrics(SM_CXPADDEDBORDER);
int scroll_width = ::GetSystemMetrics(SM_CXVSCROLL);
int scroll_height = ::GetSystemMetrics(SM_CYVSCROLL);
RECT window_rect;
@@ -2221,7 +2224,8 @@ void HWNDMessageHandler::OnWindowPosChanging(WINDOWPOS* window_pos) {
new_window_rect = monitor_rect;
} else if (IsMaximized()) {
new_window_rect = work_area;
- int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME);
+ int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME) +
+ GetSystemMetrics(SM_CXPADDEDBORDER);
new_window_rect.Inset(-border_thickness, -border_thickness);
} else {
new_window_rect = gfx::Rect(window_rect);
« no previous file with comments | « chrome/browser/ui/views/frame/browser_desktop_window_tree_host_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698