Skip to content

Commit b108fe2

Browse files
committed
NSViewComponentPeer: Only forward a mouse move event if the view is not occluded by a child view
1 parent fcf62ab commit b108fe2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/juce_gui_basics/native/juce_NSViewComponentPeer_mac.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,10 @@ void redirectMouseMove (NSEvent* ev)
754754
NSPoint screenPos = [[ev window] convertRectToScreen: NSMakeRect (windowPos.x, windowPos.y, 1.0f, 1.0f)].origin;
755755

756756
if (isWindowAtPoint ([ev window], screenPos))
757-
sendMouseEvent (ev);
757+
{
758+
if (contains (getMousePos (ev, view).roundToInt(), false))
759+
sendMouseEvent (ev);
760+
}
758761
else
759762
// moved into another window which overlaps this one, so trigger an exit
760763
handleMouseEvent (MouseInputSource::InputSourceType::mouse, MouseInputSource::offscreenMousePos, ModifierKeys::currentModifiers,

0 commit comments

Comments
 (0)