From 2191e9ecd59182e9418e53a3c0cb56421a4a6887 Mon Sep 17 00:00:00 2001 From: Andrey Lesnikov Date: Sat, 20 Jun 2020 03:42:19 +0300 Subject: [PATCH] macOS: Support click-dragging out of a window (#1607) * macos: Support click-dragging out of a window * macos: Use NSEvent::pressedMouseButtons for click-dragging * macos: Click-dragging: Move pressedMouseButtons inside --- src/platform_impl/macos/view.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/platform_impl/macos/view.rs b/src/platform_impl/macos/view.rs index 82ee5076..d764902d 100644 --- a/src/platform_impl/macos/view.rs +++ b/src/platform_impl/macos/view.rs @@ -915,8 +915,11 @@ fn mouse_motion(this: &Object, event: id) { || view_point.x > view_rect.size.width || view_point.y > view_rect.size.height { - // Point is outside of the client area (view) - return; + let mouse_buttons_down: NSInteger = msg_send![class!(NSEvent), pressedMouseButtons]; + if mouse_buttons_down == 0 { + // Point is outside of the client area (view) and no buttons are pressed + return; + } } let x = view_point.x as f64;