| Index: ui/events/cocoa/events_mac.mm
|
| diff --git a/ui/events/cocoa/events_mac.mm b/ui/events/cocoa/events_mac.mm
|
| index 99d391645730a79dde870c18b9a3e2606377451b..53578d5a723439d3ad56a88ae973062d3d425d7f 100644
|
| --- a/ui/events/cocoa/events_mac.mm
|
| +++ b/ui/events/cocoa/events_mac.mm
|
| @@ -14,6 +14,7 @@
|
| #include "ui/events/cocoa/cocoa_event_utils.h"
|
| #include "ui/events/event_utils.h"
|
| #import "ui/events/keycodes/keyboard_code_conversion_mac.h"
|
| +#import "ui/gfx/mac/coordinate_conversion.h"
|
| #include "ui/gfx/point.h"
|
| #include "ui/gfx/vector2d.h"
|
|
|
| @@ -91,11 +92,11 @@ base::TimeDelta EventTimeFromNative(const base::NativeEvent& native_event) {
|
|
|
| gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
|
| NSWindow* window = [native_event window];
|
| - if (!window) {
|
| - NOTIMPLEMENTED(); // Point will be in screen coordinates.
|
| - return gfx::Point();
|
| - }
|
| NSPoint location = [native_event locationInWindow];
|
| + // When the window is nil, locationInWindow gives screen coordinates.
|
| + if (!window)
|
| + return gfx::ScreenPointFromNSPoint(location);
|
| +
|
| NSRect content_rect = [window contentRectForFrameRect:[window frame]];
|
| return gfx::Point(location.x, NSHeight(content_rect) - location.y);
|
| }
|
|
|