Chromium Code Reviews| 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..13098ddb0b9bdb9662eeda3094a2bbdd2d49ab60 100644 |
| --- a/ui/events/cocoa/events_mac.mm |
| +++ b/ui/events/cocoa/events_mac.mm |
| @@ -87,13 +87,14 @@ base::TimeDelta EventTimeFromNative(const base::NativeEvent& native_event) { |
| } |
| gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { |
| - if (![native_event window]) { |
| + NSWindow* window = [native_event window]; |
| + if (!window) { |
| NOTIMPLEMENTED(); // Point will be in screen coordinates. |
| return gfx::Point(); |
| } |
| NSPoint location = [native_event locationInWindow]; |
| - return gfx::Point(location.x, |
| - NSHeight([[native_event window] frame]) - location.y); |
| + NSRect content_rect = [window contentRectForFrameRect:[window frame]]; |
| + return gfx::Point(location.x, NSHeight(content_rect) - location.y); |
| } |
|
tapted
2014/06/05 07:33:35
Note most of my local branches have been using a "
Robert Sesek
2014/06/05 14:08:27
I think I like extracting this information directl
|
| gfx::Point EventSystemLocationFromNative( |