Index: ui/views/event_monitor_mac.mm |
diff --git a/ui/views/event_monitor_mac.mm b/ui/views/event_monitor_mac.mm |
index 45578c9948a43fbedafc6e81c1be4cdadfa7190d..f21aae7cdd3b6d4a2cc593ead107b3f17104ba34 100644 |
--- a/ui/views/event_monitor_mac.mm |
+++ b/ui/views/event_monitor_mac.mm |
@@ -10,6 +10,7 @@ |
#include "ui/events/event.h" |
#include "ui/events/event_handler.h" |
#include "ui/events/event_utils.h" |
+#include "ui/gfx/screen.h" |
namespace views { |
@@ -28,11 +29,7 @@ scoped_ptr<EventMonitor> EventMonitor::CreateWindowMonitor( |
// static |
gfx::Point EventMonitor::GetLastMouseLocation() { |
- NSPoint mouseLocation = [NSEvent mouseLocation]; |
- // Flip coordinates to gfx (0,0 in top-left corner) using primary screen. |
- NSScreen* screen = [[NSScreen screens] firstObject]; |
- mouseLocation.y = NSMaxY([screen frame]) - mouseLocation.y; |
- return gfx::Point(mouseLocation.x, mouseLocation.y); |
+ return gfx::Screen::GetScreen()->GetCursorScreenPoint(); |
tapted
2016/03/01 08:11:58
these refactorings are good,but they should land s
|
} |
EventMonitorMac::EventMonitorMac(ui::EventHandler* event_handler, |