[java-atk-wrapper] Wrapper: remove state ARMED condition



commit 0fc6221d04073b654ece93426a9637c697a61348
Author: Magdalen Berns <m berns thismagpie com>
Date:   Fri Feb 27 21:08:06 2015 +0000

    Wrapper: remove state ARMED condition
    
    Only dispatch focus when the state is selected or focused
    Bug:https://bugzilla.gnome.org/show_bug.cgi?id=745309

 wrapper/org/GNOME/Accessibility/AtkWrapper.java.in |   29 ++++---------------
 1 files changed, 6 insertions(+), 23 deletions(-)
---
diff --git a/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in 
b/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
index c5ba31d..34cbc7c 100644
--- a/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
+++ b/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
@@ -28,7 +28,6 @@ import javax.accessibility.*;
 import java.awt.Toolkit;
 
 public class AtkWrapper {
-  public native void AtkWrapper();
   static boolean accessibilityEnabled = false;
   static {
     try {
@@ -450,6 +449,7 @@ public class AtkWrapper {
         } else if( propertyName.equals(AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY) ) {
           boolean isTextEvent = false;
           AccessibleRole role = ac.getAccessibleRole();
+          System.out.println(role);
           if ((role == AccessibleRole.TEXT) ||
               role.toDisplayString(java.util.Locale.US).equalsIgnoreCase("paragraph")) {
             isTextEvent = true;
@@ -524,31 +524,14 @@ public class AtkWrapper {
         if (parent != null) {
           parent_role = parent.getAccessibleContext().getAccessibleRole();
         }
-
-        if (newValue == javax.accessibility.AccessibleState.ARMED) {
-          if (role != null) {
-            if (role == javax.accessibility.AccessibleRole.MENU_ITEM ||
-                role == javax.accessibility.AccessibleRole.MENU) {
-              dispatchFocusEvent(o);
-            } else if (parent_role != null &&
-              (parent_role == javax.accessibility.AccessibleRole.MENU &&
-               (role == javax.accessibility.AccessibleRole.CHECK_BOX ||
-                role == javax.accessibility.AccessibleRole.RADIO_BUTTON ||
-                role == javax.accessibility.AccessibleRole.PUSH_BUTTON ||
-                role == javax.accessibility.AccessibleRole.TOGGLE_BUTTON))) {
-              dispatchFocusEvent(o);
-            }
+        if (role != null) {
+          if (newValue == javax.accessibility.AccessibleState.FOCUSED ||
+              newValue == javax.accessibility.AccessibleState.SELECTED) {
+            dispatchFocusEvent(o);
           }
-        } else if (newValue == javax.accessibility.AccessibleState.SELECTED &&
-                               o instanceof AccessibleContext &&
-                               role == javax.accessibility.AccessibleRole.MENU) {
-          dispatchFocusEvent(o);
-        } else if (newValue == javax.accessibility.AccessibleState.FOCUSED) {
-          dispatchFocusEvent(o);
         }
-
         AccessibleState state;
-        boolean value;
+        boolean value = false;
         if (newValue != null) {
           state = (AccessibleState)newValue;
           value = true;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]