This patch fixes PR 25165.  If an attempt is made to give focus to a
Component that already has it, no FOCUS_LOST and FOCUS_GAINED events
should be processed.

2005-11-30  Anthony Balkissoon  <[EMAIL PROTECTED]>

        * java/awt/Component.java:
        (processFocusEvent): Don't dispatch events if the focus opposite is the
        same as the receiving Component.

--Tony
Index: java/awt/Component.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v
retrieving revision 1.89
diff -u -r1.89 Component.java
--- java/awt/Component.java	23 Nov 2005 14:44:33 -0000	1.89
+++ java/awt/Component.java	30 Nov 2005 18:00:32 -0000
@@ -3019,6 +3019,11 @@
     if (focusListener == null)
       return;
 
+    // Don't dispatch FOCUS_GAINED or FOCUS_LOST events if the opposite
+    // Component is the same as the receiving Component.
+    if (e.getOppositeComponent() == this)
+      return;
+    
     switch (e.id)
       {
         case FocusEvent.FOCUS_GAINED:
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to