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

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

Issue 303543004: MacViews: views_examples_with_content_exe working! Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add files Created 6 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 | « ui/compositor/compositor.cc ('k') | ui/gfx/canvas.cc » ('j') | no next file with comments »
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 | « ui/compositor/compositor.cc ('k') | ui/gfx/canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698