summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2013-06-27 00:03:50 +0200
committerDavid Ostrovsky <david@ostrovsky.org>2013-06-27 02:44:33 +0200
commit7746de6e42d5957fa62fa278e2c46a0cb472dc01 (patch)
tree54b1344e1566a88133b1645c0436b2f1f373f6f2
parente513fffeac1f4a814f644f156d88fc8810af4e46 (diff)
fdo#58995 fix focus gain/lost events dropping on JDK 1.7
With JDK upgrade to 1.7.x focus gain/lost events were dropped and thus not discoverable by AT tools. The problem has nothing to do with different packaging of JAB (2.0.3 is included with JDK 1.7u6 and higher). The reason for the event droping was a new check in DefaultKeyboardFocusManager.java that was introduced in JDK 1.7.x: @@ -294,18 +271,10 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { - if (!(newFocusedWindow.isFocusableWindow() - && newFocusedWindow.isVisible() - && newFocusedWindow.isDisplayable())) - { - // we can not accept focus on such window, so reject it. - restoreFocus(we); - break; - } With this check in place it is assumed that Component.isDisplayable() must return true, for event to be dispatched. But particularly `Dialog.isDisplayable()` didn't and thus all tab key events (focus traversal) were dropped. Many thanks to Jamie and Stuart for helping out with reproducing and tracking that down! Change-Id: I4876773199ca06a6e73213401692e8275a1f3b22
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/Dialog.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/Dialog.java b/accessibility/bridge/org/openoffice/java/accessibility/Dialog.java
index f7c1c08466fb..a9b2d51a42de 100644
--- a/accessibility/bridge/org/openoffice/java/accessibility/Dialog.java
+++ b/accessibility/bridge/org/openoffice/java/accessibility/Dialog.java
@@ -124,6 +124,27 @@ public class Dialog extends java.awt.Dialog implements javax.accessibility.Acces
}
/**
+ * Determines whether this component is displayable. A component is
+ * displayable when it is connected to a native screen resource.
+ * <p>
+ * A component is made displayable either when it is added to
+ * a displayable containment hierarchy or when its containment
+ * hierarchy is made displayable.
+ * A containment hierarchy is made displayable when its ancestor
+ * window is either packed or made visible.
+ * <p>
+ * A component is made undisplayable either when it is removed from
+ * a displayable containment hierarchy or when its containment hierarchy
+ * is made undisplayable. A containment hierarchy is made
+ * undisplayable when its ancestor window is disposed.
+ *
+ * @return <code>true</code> if the component is displayable
+ */
+ public boolean isDisplayable() {
+ return true;
+ }
+
+ /**
* Shows or hides this component depending on the value of parameter
* <code>b</code>.
* @param b if <code>true</code>, shows this component;