IDEA-101256 Cannot disable scrollwheel tab switching

This commit is contained in:
Vassiliy Kudryashov
2013-04-17 15:26:37 +04:00
parent 9c572278d1
commit e49954b8a8
@@ -324,7 +324,19 @@ public class IdeEventQueue extends EventQueue {
}
@Override
public void dispatchEvent(final AWTEvent e) {
public void dispatchEvent(AWTEvent e) {
if (SystemInfo.isXWindow && e instanceof MouseEvent && ((MouseEvent)e).getButton() > 3) {
MouseEvent src = (MouseEvent)e;
if (src.getButton() < 6) {
e = new MouseWheelEvent(src.getComponent(), src.getID(), src.getWhen(),
src.getModifiers() | InputEvent.SHIFT_DOWN_MASK, src.getX(), src.getY(),
0, false, MouseWheelEvent.WHEEL_UNIT_SCROLL, src.getClickCount(), src.getButton() == 4 ? -1 : 1);
}
else {
e = new MouseEvent(src.getComponent(), src.getID(), src.getWhen(), src.getModifiers() | (1 << 8 + src.getButton()),
src.getX(), src.getY(), 1, src.isPopupTrigger(), src.getButton() - 2);
}
}
boolean wasInputEvent = myIsInInputEvent;
myIsInInputEvent = e instanceof InputEvent || e instanceof InputMethodEvent || e instanceof WindowEvent || e instanceof ActionEvent;
AWTEvent oldEvent = myCurrentEvent;