From: patr0nus Date: Sat, 25 Oct 2014 03:06:39 +0000 (+0800) Subject: Remove the deprecated convertScreenToBase and convertBaseToScreen. X-Git-Tag: v0.19.0~4^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=915a6196cc750d80f9f3682e33581ba84bb04aa9;p=electron.git Remove the deprecated convertScreenToBase and convertBaseToScreen. --- diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 1475e53f..0e96c09b 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -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; diff --git a/atom/browser/ui/cocoa/event_processing_window.mm b/atom/browser/ui/cocoa/event_processing_window.mm index ed22592b..e58477d7 100644 --- a/atom/browser/ui/cocoa/event_processing_window.mm +++ b/atom/browser/ui/cocoa/event_processing_window.mm @@ -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;