You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Judging from the original Snippet291 example code, it looks like for TreeItems the handle is used as childID. This is broken, because the long handle of a TreeItem does not fit into the int of AccessibleEvent.childID.
To Reproduce
Please run the below (modified) snippet 291
importorg.eclipse.swt.*;
importorg.eclipse.swt.accessibility.*;
importorg.eclipse.swt.graphics.*;
importorg.eclipse.swt.layout.*;
importorg.eclipse.swt.widgets.*;
publicclassSnippet291 {
publicstaticvoidmain(String[] args) {
finalDisplaydisplay = newDisplay();
Shellshell = newShell(display);
shell.setText("Snippet 291");
shell.setLayout(newFillLayout());
finalTreetree = newTree(shell, SWT.BORDER);
for (inti = 0; i < 5; i++) {
TreeItemtreeItem = newTreeItem (tree, SWT.NONE);
treeItem.setText ("item" + i);
for (intj = 0; j < 3; j++) {
TreeItemsubItem = newTreeItem(treeItem, SWT.NONE);
subItem.setText("item" + i + j);
}
}
tree.getAccessible().addAccessibleListener(newAccessibleAdapter() {
@OverridepublicvoidgetName(AccessibleEvente) {
if (e.childID == ACC.CHILDID_SELF) {
e.result = "This is the Accessible Name for the Tree";
} else {
TreeItemitem = (TreeItem)display.findWidget(tree, e.childID);
if (item != null) {
e.result = "This is the Accessible Name for the TreeItem: " + item.getText();
}
else {
System.out.println("getName: no item found for " + Long.toHexString(e.childID));
}
}
}
});
tree.getAccessible().addAccessibleControlListener(newAccessibleControlAdapter() {
@OverridepublicvoidgetChildAtPoint(AccessibleControlEvente) {
finalPointlocation = tree.toControl(e.x, e.y);
finalTreeItemitem = tree.getItem(location);
if (item != null) {
System.out.println("getChildAtPoint " + Long.toHexString(item.handle));
}
}
});
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
}
while a screenreader like NVDA is running. Moving the mouse over the tree items should speak something like "This is the Accessible Name for the TreeItem", but it doesn't. As you can see from the console, the long value of the handle is cut-off:
getName: no item found for ffffffffd929c800
getName: no item found for ffffffffd929c800
getName: no item found for ffffffffd929c800
getChildAtPoint 1fad929c800
getChildAtPoint 1fad929c800
getChildAtPoint 1fad929c800
...
Expected behavior
Well, AccessibleControlEvent.childID should be large enough to fit the control handle inside. Looks like it needs to be changed from int to long.
Environment:
Select the platform(s) on which the behavior is seen:
All OS
Windows
Linux
macOS
Additional OS info (e.g. OS version, Linux Desktop, etc)
Only tried on Windows 11 so far.
The text was updated successfully, but these errors were encountered:
Describe the bug
Judging from the original Snippet291 example code, it looks like for
TreeItem
s the handle is used aschildID
. This is broken, because thelong handle
of aTreeItem
does not fit into theint
ofAccessibleEvent.childID
.To Reproduce
Please run the below (modified) snippet 291
while a screenreader like NVDA is running. Moving the mouse over the tree items should speak something like "This is the Accessible Name for the TreeItem", but it doesn't. As you can see from the console, the
long
value of thehandle
is cut-off:Expected behavior
Well,
AccessibleControlEvent.childID
should be large enough to fit the control handle inside. Looks like it needs to be changed fromint
tolong
.Environment:
Only tried on Windows 11 so far.
The text was updated successfully, but these errors were encountered: