Modals & desktop global mouse listeners - mouseUp blocked

In Component::internalMouseDown() mouse listeners registered via Desktop::addGlobalMouseListener() are given mouse-down events when some other component is modal. But the same is not true in Component::internalMouseUp() - it simply returns immediately due to the first statement.

//// These two lines exist in internalMouseDown:
// allow blocked mouse-events to go to global listeners..
desktop.getMouseListeners().callChecked (checker, [&] (MouseListener& l) { l.mouseDown (checker.eventWithNearestParent()); });

//// But in internalMouseUp it just returns immediately:
if (flags.mouseDownWasBlocked && isCurrentlyBlockedByAnotherModalComponent())
    return;

The result is that a modal component can find out if any other component gets a mouse down, but not a mouse up. This seems asymmetrical.

1 Like