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

Unified Diff: chrome/browser/ui/views/frame/glass_browser_frame_view.cc

Issue 2011723002: Floor rather than round the top border thickness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/glass_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index c596d600496495a5270763052688065d76efd906..772e2babfdd012a5acf48bd5ac0151c93f1b937a 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -326,12 +326,17 @@ int GlassBrowserFrameView::FrameTopBorderThickness(bool restored) const {
// windows an offscreen CYSIZEFRAME-thick region around the edges. The
// left/right/bottom edges don't worry about this because we cancel them out
// in BrowserDesktopWindowTreeHostWin::GetClientAreaInsets() so the offscreen
- // area is non-client as far as Windows is concerned. However because we want
- // to push away the top part of the glass's gradient in Win7 we set the top
- // client inset to 0. Thus we must compensate here to avoid having UI elements
- // drift off the top of the screen.
- return (frame()->IsFullscreen() && !restored) ?
- 0 : display::win::GetSystemMetricsInDIP(SM_CYSIZEFRAME);
+ // area is non-client as far as Windows is concerned. However we can't do this
+ // with the top inset because otherwise Windows will give us a standard
+ // titlebar. Thus we must compensate here to avoid having UI elements drift
+ // off the top of the screen.
+ if (frame()->IsFullscreen() && !restored)
+ return 0;
+ // Mouse and touch locations are floored but GetSystemMetricsInDIP is rounded,
+ // so we need to floor instead or else the difference will cause the hittest
+ // to fail when it ought to succeed.
+ return std::floor(GetSystemMetrics(SM_CYSIZEFRAME) /
+ display::win::GetDPIScale());
}
int GlassBrowserFrameView::TopAreaHeight(bool restored) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698