I made this change because I found in some case events were not being
dispatched properly. 

If in the MOUSE_CLICKED event we find that the candidate (for
mouseEventTarget) and the pressedComponent are not equal, null is
returned for the mouseEventTarget. In this case, I think that pressCount
should be reset to 0, since MOUSE_PRESSED and MOUSE_RELEASED events are
not going to be dispatched for this component. Also, pressedComponent
will be reset to something else when MOUSE_PRESSED is dispatched the
next time (and pressCount will be incremented appropriately).

I don't want to commit this patch until it gets approved from someone (I
may be overlooking something).

Thanks!


2005-11-11  Lillian Angel  <[EMAIL PROTECTED]>

        * java/awt/Container.java
        (LightweightDispatcher.acquireComponentForMouseEvent): If the 
        event is not being dispatched, the pressCount should be reset.
Index: java/awt/Container.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Container.java,v
retrieving revision 1.67
diff -u -r1.67 Container.java
--- java/awt/Container.java	8 Nov 2005 13:25:30 -0000	1.67
+++ java/awt/Container.java	10 Nov 2005 22:56:00 -0000
@@ -2166,7 +2166,10 @@
         // Don't dispatch CLICKED events whose target is not the same as the
         // target for the original PRESSED event.
         if (candidate != pressedComponent)
-          mouseEventTarget = null;
+          {
+            mouseEventTarget = null;
+            pressCount = 0;
+          }
         else if (pressCount == 0)
           pressedComponent = null;
       }



_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to