/[classpath]/classpath/java/awt/Component.java
ViewVC logotype

Diff of /classpath/java/awt/Component.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.90 by abalkiss, Wed Nov 30 18:03:07 2005 UTC revision 1.91 by abalkiss, Wed Nov 30 19:19:23 2005 UTC
# Line 3019  public abstract class Component Line 3019  public abstract class Component
3019      if (focusListener == null)      if (focusListener == null)
3020        return;        return;
3021    
     // 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;  
       
3022      switch (e.id)      switch (e.id)
3023        {        {
3024          case FocusEvent.FOCUS_GAINED:          case FocusEvent.FOCUS_GAINED:
# Line 4796  p   * <li>the set of backward traversal Line 4791  p   * <li>the set of backward traversal
4791    void dispatchEventImpl(AWTEvent e)    void dispatchEventImpl(AWTEvent e)
4792    {    {
4793      Event oldEvent = translateEvent (e);      Event oldEvent = translateEvent (e);
4794        // This boolean tells us not to process focus events when the focus
4795        // opposite component is the same as the focus component.
4796        boolean ignoreFocus =
4797          (e instanceof FocusEvent &&
4798           ((FocusEvent)e).getComponent() == ((FocusEvent)e).getOppositeComponent());
4799        
4800      if (oldEvent != null)      if (oldEvent != null)
4801        postEvent (oldEvent);        postEvent (oldEvent);
4802    
# Line 4827  p   * <li>the set of backward traversal Line 4827  p   * <li>the set of backward traversal
4827                  break;                  break;
4828                }                }
4829            }            }
4830          if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE)          if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE
4831                && !ignoreFocus)
4832            processEvent(e);            processEvent(e);
4833        }        }
4834    

Legend:
Removed from v.1.90  
changed lines
  Added in v.1.91

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26