Index: chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc |
diff --git a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc |
index b2301e69bcfb06ec07e0dd16cf907c8173bb12e1..be9a207739527d43786b82e5496f2942be979e01 100644 |
--- a/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc |
+++ b/chrome/browser/ui/views/apps/app_window_desktop_window_tree_host_win.cc |
@@ -73,10 +73,19 @@ void AppWindowDesktopWindowTreeHostWin::UpdateDWMFrame() { |
// Otherwise, we need to figure out how to extend the glass in. |
if (app_window_->glass_frame_view()) { |
gfx::Insets insets = app_window_->glass_frame_view()->GetGlassInsets(); |
- margins.cxLeftWidth = insets.left(); |
- margins.cxRightWidth = insets.right(); |
- margins.cyBottomHeight = insets.bottom(); |
- margins.cyTopHeight = insets.top(); |
+ // The DWM API's expect values in pixels. We need to convert from DIP to |
+ // pixels here. |
+ gfx::Rect insets_rect_in_pixels(insets.left(), |
+ insets.top(), |
+ insets.right() - insets.left(), |
+ insets.bottom() - insets.top()); |
+ insets_rect_in_pixels = gfx::win::DIPToScreenRect(insets_rect_in_pixels); |
+ margins.cxLeftWidth = insets_rect_in_pixels.x(); |
+ margins.cxRightWidth = |
+ insets_rect_in_pixels.x() + insets_rect_in_pixels.width(); |
+ margins.cyBottomHeight = |
+ insets_rect_in_pixels.y() + insets_rect_in_pixels.height(); |
+ margins.cyTopHeight = insets_rect_in_pixels.y(); |
} |
DwmExtendFrameIntoClientArea(GetHWND(), &margins); |