Hello! I’m looking into the dispatching routine in AWT/Swing and stumbled
upon the following piece of code in
*java.awt.LightweightDispatcher#processMouseEvent*
<https://github.com/openjdk/jdk/blob/4a9cc8a000cafb3ad77a33710054b567e8553652/src/java.desktop/share/classes/java/awt/Container.java#L4591>
:
case MouseEvent.MOUSE_DRAGGED:
> if (isMouseGrab(e)) {
> retargetMouseEvent(met, id, e);
> }
> break;
In case of *MOUSE_DRAGGED* events, *isMouseGrab* basically checks if the
event has any pressed mouse buttons (in modifiers). I wonder why it has
been handled explicitly? AFAIU *MOUSE_DRAGGED* events always have some
pressed mouse buttons, otherwise that’s not possible to drag, don’t they?
Best regards,
Nikita Provotorov