summaryrefslogtreecommitdiff
path: root/java/awt/Component.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/awt/Component.java')
-rw-r--r--java/awt/Component.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/java/awt/Component.java b/java/awt/Component.java
index dfc49f386..7d4346582 100644
--- a/java/awt/Component.java
+++ b/java/awt/Component.java
@@ -4792,7 +4792,12 @@ p * <li>the set of backward traversal keys
void dispatchEventImpl(AWTEvent e)
{
Event oldEvent = translateEvent (e);
-
+ // This boolean tells us not to process focus events when the focus
+ // opposite component is the same as the focus component.
+ boolean ignoreFocus =
+ (e instanceof FocusEvent &&
+ ((FocusEvent)e).getComponent() == ((FocusEvent)e).getOppositeComponent());
+
if (oldEvent != null)
postEvent (oldEvent);
@@ -4823,7 +4828,8 @@ p * <li>the set of backward traversal keys
break;
}
}
- if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE)
+ if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE
+ && !ignoreFocus)
processEvent(e);
}