]> khamidou — GitHub mirrors - electron.git/commitdiff
Remove the deprecated convertScreenToBase and convertBaseToScreen.
authorpatr0nus <patronum@outlook.com>
Sat, 25 Oct 2014 03:06:39 +0000 (11:06 +0800)
committerpatr0nus <patronum@outlook.com>
Sat, 25 Oct 2014 03:06:39 +0000 (11:06 +0800)
atom/browser/native_window_mac.mm
atom/browser/ui/cocoa/event_processing_window.mm

index 1475e53f1c1f2efdd360dcf0f32e3df7adffd625..0e96c09b914007c7b46acd32705aa1b18037983b 100644 (file)
@@ -604,8 +604,10 @@ bool NativeWindowMac::IsWithinDraggableRegion(NSPoint point) const {
 }
 
 void NativeWindowMac::HandleMouseEvent(NSEvent* event) {
-  NSPoint current_mouse_location =
-      [window_ convertBaseToScreen:[event locationInWindow]];
+  NSPoint eventLoc = [event locationInWindow];
+  NSRect mouseRect = [window_ convertRectToScreen:NSMakeRect(eventLoc.x, eventLoc.y, 0, 0)];
+  NSPoint current_mouse_location = mouseRect.origin;
+
 
   if ([event type] == NSLeftMouseDown) {
     NSPoint frame_origin = [window_ frame].origin;
index ed22592b376f54bdc8cca7c684fb365b871955ca..e58477d7efda4451ceb62d105b4b83b7f59c4d72 100644 (file)
@@ -58,8 +58,8 @@
   // Convert the event's location from the original window's coordinates into
   // our own.
   NSPoint eventLoc = [event locationInWindow];
-  eventLoc = [[event window] convertBaseToScreen:eventLoc];
-  eventLoc = [self convertScreenToBase:eventLoc];
+  eventLoc = [self convertRectFromScreen:
+    [[event window] convertRectToScreen:NSMakeRect(eventLoc.x, eventLoc.y, 0, 0)]].origin;
 
   // Various things *only* apply to key down/up.
   BOOL eventIsARepeat = NO;