diff --git a/modules/juce_gui_basics/native/juce_NSViewComponentPeer_mac.mm b/modules/juce_gui_basics/native/juce_NSViewComponentPeer_mac.mm index ed9cd36b1bf..391fdcd1a12 100644 --- a/modules/juce_gui_basics/native/juce_NSViewComponentPeer_mac.mm +++ b/modules/juce_gui_basics/native/juce_NSViewComponentPeer_mac.mm @@ -745,12 +745,15 @@ void redirectMouseMove (NSEvent* ev) NSPoint windowPos = [ev locationInWindow]; NSPoint screenPos = [[ev window] convertRectToScreen: NSMakeRect (windowPos.x, windowPos.y, 1.0f, 1.0f)].origin; - if (isWindowAtPoint ([ev window], screenPos)) - sendMouseEvent (ev); - else + if (isWindowAtPoint ([ev window], screenPos)) { + if ([[[ev window] contentView] hitTest: windowPos] == view) { + sendMouseEvent (ev); + } + } else { // moved into another window which overlaps this one, so trigger an exit handleMouseEvent (MouseInputSource::InputSourceType::mouse, MouseInputSource::offscreenMousePos, ModifierKeys::currentModifiers, getMousePressure (ev), MouseInputSource::defaultOrientation, getMouseTime (ev)); + } showArrowCursorIfNeeded(); }