summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/Frame.java2
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/Window.java7
2 files changed, 9 insertions, 0 deletions
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/Frame.java b/accessibility/bridge/org/openoffice/java/accessibility/Frame.java
index 4a0c44a5a99f..a055d2051221 100644
--- a/accessibility/bridge/org/openoffice/java/accessibility/Frame.java
+++ b/accessibility/bridge/org/openoffice/java/accessibility/Frame.java
@@ -65,6 +65,7 @@ public class Frame extends java.awt.Frame implements javax.accessibility.Accessi
boolean opened = false;
boolean visible = false;
+ boolean active = false;
java.awt.EventQueue eventQueue = null;
@@ -205,6 +206,7 @@ public class Frame extends java.awt.Frame implements javax.accessibility.Accessi
protected void setComponentState(short state, boolean enable) {
switch (state) {
case AccessibleStateType.ACTIVE:
+ active = enable;
if (enable) {
AccessibleObjectFactory.postWindowActivated(Frame.this);
} else {
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/Window.java b/accessibility/bridge/org/openoffice/java/accessibility/Window.java
index c02ff91cad56..81a85cf991c6 100644
--- a/accessibility/bridge/org/openoffice/java/accessibility/Window.java
+++ b/accessibility/bridge/org/openoffice/java/accessibility/Window.java
@@ -182,6 +182,13 @@ public class Window extends java.awt.Window implements javax.accessibility.Acces
public void dispose() {
setVisible(false);
postWindowEvent(java.awt.event.WindowEvent.WINDOW_CLOSED);
+
+ // Transfer window focus back to the owner window if it is still the active frame
+ if ((getOwner() instanceof Frame && ((Frame) getOwner()).active) ||
+ (getOwner() instanceof Dialog && ((Dialog) getOwner()).active)) {
+ eventQueue.postEvent(new java.awt.event.WindowEvent(getOwner(),
+ java.awt.event.WindowEvent.WINDOW_GAINED_FOCUS));
+ }
}
protected void postWindowEvent(int i) {