<AWT Dev>  Review request for 7026679 There is no MouseClicked event after MousePressed & MouseReleased events
alexandr.scherbatiy at oracle.com
Thu May 30 02:13:54 PDT 2013
Could you review the fix:
This is the direct fix proposed in the issue.
XWindow keep track of button press-releases within the
mouseButtonClickAllowed bitmask. The problem is it's per-window field.
With JComboBox some events comes to XContentWindow some into XFramePeer
due to the specifics of this component - it opens extra toplevel window
for the dropdown.
E.g. MOUSE_PRESS comes to XContentWindow and update its
mouseButtonClickAllowed version with proper value (say 512 - left
button). But MOUSE_RELEASE comes to XFramePeer which
mouseButtonClickAllowed value is 0.
Later on it checks for its state in XWindow.handleMousePressRelease:
if ((type == XConstants.ButtonRelease) &&
XConstants.buttonsMask[lbutton]) != 0) ) // No up-button in the drag-state
<construct and post a CLICK_EVENT>
But unfortunately it's value is 0 instead of 512 so we just skip
It seems that making this variable static is reasonable approach to keep
the state of the mouse.
More information about the awt-dev