src/macosx/classes/sun/lwawt/LWComponentPeer.java

Print this page

        

@@ -1225,14 +1225,14 @@
 
         sendEventToDelegate(e);
     }
 
     protected void sendEventToDelegate(final AWTEvent e) {
-        synchronized (getDelegateLock()) {
             if (getDelegate() == null || !isShowing() || !isEnabled()) {
                 return;
             }
+        synchronized (getDelegateLock()) {
             AWTEvent delegateEvent = createDelegateEvent(e);
             if (delegateEvent != null) {
                 AWTAccessor.getComponentAccessor()
                         .processEvent((Component) delegateEvent.getSource(),
                                 delegateEvent);

@@ -1242,11 +1242,16 @@
                 }
             }
         }
     }
 
-    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;
             delegateEvent = new MouseWheelEvent(
                     delegate, me.getID(), me.getWhen(),