7141296: [macosx] Mouse Wheel Turn closes combobox popup

Reviewed-by: rupashka
This commit is contained in:
Alexander Scherbatiy 2012-05-30 14:58:30 +04:00
parent f904017c74
commit da6cfab105
2 changed files with 11 additions and 1 deletions

View File

@ -60,6 +60,10 @@ public class AquaScrollPaneUI extends javax.swing.plaf.basic.BasicScrollPaneUI {
if (wasVisible) {
vScrollBar.setVisible(true);
}
// Consume the event even when the scrollBar is invisible
// see #7124320
e.consume();
}
}
}

View File

@ -109,8 +109,14 @@ final class CPlatformResponder {
final long when = System.currentTimeMillis();
final int scrollType = MouseWheelEvent.WHEEL_UNIT_SCROLL;
final int scrollAmount = 1;
int wheelRotation = (int) delta;
int signum = (int) Math.signum(delta);
if (signum * delta < 1) {
wheelRotation = signum;
}
// invert the wheelRotation for the peer
peer.dispatchMouseWheelEvent(when, x, y, modifiers, scrollType,
scrollAmount, (int) -delta, -delta, null);
scrollAmount, -wheelRotation, -delta, null);
}
/**