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

Unified Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm

Issue 1146873002: [MacViews] Enable dragging a window by its caption/draggable areas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to single repost and [NSWindow setMovableByWindowBackground]. Created 5 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
Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
index 5eaf26d1d1b176bfc5e37e8b70eaa7189c5bb33f..e7de1ed417159445864f78ff76db1330d1841c7e 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm
@@ -69,7 +69,15 @@ gfx::Rect BrowserNonClientFrameViewMac::GetWindowBoundsForClientBounds(
}
int BrowserNonClientFrameViewMac::NonClientHitTest(const gfx::Point& point) {
- return frame()->client_view()->NonClientHitTest(point);
+ int component = frame()->client_view()->NonClientHitTest(point);
tapted 2015/06/03 00:28:37 maybe we need to encode the close/minimize button
jackhou1 2015/06/03 04:04:44 I was thinking we could do our own NSView hit-test
+
+ // BrowserView::NonClientHitTest will return HTNOWHERE for points that hit
+ // the native title bar. On Mac, we need to explicitly return HTCAPTION for
+ // those points.
+ if (component == HTNOWHERE && bounds().Contains(point))
+ return HTCAPTION;
+
+ return component;
}
void BrowserNonClientFrameViewMac::GetWindowMask(const gfx::Size& size,

Powered by Google App Engine
This is Rietveld 408576698