diff options
author | Niraj Modi | 2014-01-09 07:42:25 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2014-01-10 01:15:28 -0500 |
commit | 5b8cefcb6dd3cedb939b3c00a1e12e7ba4986b99 (patch) | |
tree | 38e147c6d8729c2a49116bff241a7e7c025c52be | |
parent | 3521befe615a80cdbc530b1a5bc24889c0582e07 (diff) | |
download | eclipse.platform.swt-5b8cefcb6dd3cedb939b3c00a1e12e7ba4986b99.zip eclipse.platform.swt-5b8cefcb6dd3cedb939b3c00a1e12e7ba4986b99.tar.gz eclipse.platform.swt-5b8cefcb6dd3cedb939b3c00a1e12e7ba4986b99.tar.xz |
Bug 421255 - [Accessibility] [Regression] - JAWS does not read text from
label associated with text field
Change-Id: I436f839ebde729628fb072c750e52063626ba490
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java index 834322e..1a17fe8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java @@ -1295,7 +1295,7 @@ public class Accessible { */ public void sendEvent(int event, Object eventData) { checkWidget(); - if (refCount <= 1) return; + if (!isATRunning ()) return; if (!UseIA2) return; if (DEBUG) print(this + ".NotifyWinEvent " + getEventString(event) + " hwnd=" + control.handle + " childID=" + eventChildID()); switch (event) { @@ -1419,7 +1419,7 @@ public class Accessible { */ public void sendEvent(int event, Object eventData, int childID) { checkWidget(); - if (refCount <= 1) return; + if (!isATRunning ()) return; if (!UseIA2) return; int osChildID = childID == ACC.CHILDID_SELF ? eventChildID() : childIDToOs(childID); if (DEBUG) print(this + ".NotifyWinEvent " + getEventString(event) + " hwnd=" + control.handle + " childID=" + osChildID); @@ -1455,7 +1455,7 @@ public class Accessible { */ public void selectionChanged () { checkWidget(); - if (refCount <= 1) return; + if (!isATRunning ()) return; if (DEBUG) print(this + ".NotifyWinEvent EVENT_OBJECT_SELECTIONWITHIN hwnd=" + control.handle + " childID=" + eventChildID()); COM.NotifyWinEvent (COM.EVENT_OBJECT_SELECTIONWITHIN, control.handle, COM.OBJID_CLIENT, eventChildID()); } @@ -1473,7 +1473,7 @@ public class Accessible { */ public void setFocus(int childID) { checkWidget(); - if (refCount <= 1) return; + if (!isATRunning ()) return; int osChildID = childID == ACC.CHILDID_SELF ? eventChildID() : childIDToOs(childID); if (DEBUG) print(this + ".NotifyWinEvent EVENT_OBJECT_FOCUS hwnd=" + control.handle + " childID=" + osChildID); COM.NotifyWinEvent (COM.EVENT_OBJECT_FOCUS, control.handle, COM.OBJID_CLIENT, osChildID); @@ -1494,7 +1494,7 @@ public class Accessible { */ public void textCaretMoved (int index) { checkWidget(); - if (refCount <= 1) return; + if (!isATRunning ()) return; if (DEBUG) print(this + ".NotifyWinEvent EVENT_OBJECT_LOCATIONCHANGE hwnd=" + control.handle + " childID=" + eventChildID()); COM.NotifyWinEvent (COM.EVENT_OBJECT_LOCATIONCHANGE, control.handle, COM.OBJID_CARET, eventChildID()); if (!UseIA2) return; @@ -1523,7 +1523,7 @@ public class Accessible { */ public void textChanged (int type, int startIndex, int length) { checkWidget(); - if (refCount <= 1) return; + if (!isATRunning ()) return; AccessibleTextEvent event = new AccessibleTextEvent(this); event.start = startIndex; event.end = startIndex + length; @@ -1559,7 +1559,7 @@ public class Accessible { */ public void textSelectionChanged () { checkWidget(); - if (refCount <= 1) return; + if (!isATRunning ()) return; if (DEBUG) print(this + ".NotifyWinEvent EVENT_OBJECT_VALUECHANGE hwnd=" + control.handle + " childID=" + eventChildID()); COM.NotifyWinEvent (COM.EVENT_OBJECT_VALUECHANGE, control.handle, COM.OBJID_CLIENT, eventChildID()); } @@ -5141,6 +5141,14 @@ public class Accessible { if (control.isDisposed ()) SWT.error (SWT.ERROR_WIDGET_DISPOSED); } + boolean isATRunning () { + /* Currently there is no accurate way to get this information from 'refCount' + * JAWS screen reader cannot be detected using 'refCount' approach, + * as 'refCount' continues to be 1 even when JAWS is running. */ + // if (refCount <= 1) return false; + return true; + } + /* isValidThread was copied from Widget, and rewritten to work in this package */ boolean isValidThread () { return control.getDisplay ().getThread () == Thread.currentThread (); |