mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-22 08:21:27 +00:00
7194902: [macosx] closed/java/awt/Button/DoubleActionEventTest/DoubleActionEventTest failed since jdk8b49
7181403: Invalid MouseEvent conversion with SwingUtilities.convertMouseEvent Reviewed-by: malenkov, alexsch
This commit is contained in:
parent
19bc54290f
commit
b6a841d5a3
@ -1227,10 +1227,10 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
|
||||
}
|
||||
|
||||
protected void sendEventToDelegate(final AWTEvent e) {
|
||||
if (getDelegate() == null || !isShowing() || !isEnabled()) {
|
||||
return;
|
||||
}
|
||||
synchronized (getDelegateLock()) {
|
||||
if (getDelegate() == null || !isShowing() || !isEnabled()) {
|
||||
return;
|
||||
}
|
||||
AWTEvent delegateEvent = createDelegateEvent(e);
|
||||
if (delegateEvent != null) {
|
||||
AWTAccessor.getComponentAccessor()
|
||||
@ -1244,7 +1244,12 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
|
||||
}
|
||||
}
|
||||
|
||||
protected AWTEvent createDelegateEvent(AWTEvent e) {
|
||||
/**
|
||||
* Changes the target of the AWTEvent from awt component to appropriate
|
||||
* swing delegate.
|
||||
*/
|
||||
private AWTEvent createDelegateEvent(final AWTEvent e) {
|
||||
// TODO modifiers should be changed to getModifiers()|getModifiersEx()?
|
||||
AWTEvent delegateEvent = null;
|
||||
if (e instanceof MouseWheelEvent) {
|
||||
MouseWheelEvent me = (MouseWheelEvent) e;
|
||||
|
||||
@ -356,7 +356,7 @@ public class SwingUtilities implements SwingConstants
|
||||
sourceEvent.getYOnScreen(),
|
||||
sourceEvent.getClickCount(),
|
||||
sourceEvent.isPopupTrigger(),
|
||||
MouseEvent.NOBUTTON );
|
||||
sourceEvent.getButton());
|
||||
}
|
||||
return newEvent;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user