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

Unified Diff: ui/events/cocoa/events_mac.mm

Issue 309483009: Remaining bits to get views_examples_with_content_exe to work on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: neater still Created 6 years, 6 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 | ui/gfx/gfx.gyp » ('j') | ui/gfx/mac/point_utils.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/cocoa/events_mac.mm
diff --git a/ui/events/cocoa/events_mac.mm b/ui/events/cocoa/events_mac.mm
index a8d93650b3610e402a5b7915be43d3bdec0035a8..34573d50816ac90c06f54aaaffb33a59934f7549 100644
--- a/ui/events/cocoa/events_mac.mm
+++ b/ui/events/cocoa/events_mac.mm
@@ -92,8 +92,10 @@ gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
return gfx::Point();
}
NSPoint location = [native_event locationInWindow];
- return gfx::Point(location.x,
- NSHeight([[native_event window] frame]) - location.y);
+ NSRect window_frame = [[native_event window] frame];
+ CGFloat content_height =
+ NSHeight([[native_event window] contentRectForFrameRect:window_frame]);
+ return gfx::Point(location.x, content_height - location.y);
}
gfx::Point EventSystemLocationFromNative(
« no previous file with comments | « no previous file | ui/gfx/gfx.gyp » ('j') | ui/gfx/mac/point_utils.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698