Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ui/accessible/ui_accessible_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,11 @@ QStringList Widget::actionNames() const {
}

void Widget::doAction(const QString &actionName) {
// On Qt 5 the Windows UIA bridge redirects a container's SetFocus to
// focusChild() only for an element exposing a table interface, not for a
// List - so focus would land on the inert container. Forward SetFocus to
// the selected item's widget directly instead (no extra Qt patch needed).
// Opt-in, so only a selection list (the folder strip) is affected.
// The items of a selection list are real widgets and it is they, not the
// container, that keep the keyboard focus: they handle the arrow keys and
// carry the list's single Tab-stop. So a container SetFocus has to land on
// the selected item - taking focus there announces it by itself. Opt-in,
// so only a selection list (the folder strip) is affected.
if (actionName == QAccessibleActionInterface::setFocusAction()
&& rp()->accessibilitySelectionList()) {
if (const auto selected = selectedItem(0)) {
Expand Down
9 changes: 9 additions & 0 deletions ui/rp_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,15 @@ class RpWidget : public RpWidgetBase<QWidget> {
[[nodiscard]] virtual QAccessible::Role accessibilityChildSubItemRole() const;
[[nodiscard]] virtual QString accessibilityChildSubItemName(int row, int column) const;
[[nodiscard]] virtual QString accessibilityChildSubItemValue(int row, int column) const;

// Announces a child as the one holding accessible focus. Meant for a
// browse position that moves while keyboard focus stays put - arrow keys
// inside a painted list, say. Taking keyboard focus needs no call: that
// raises a focus event of its own which the platform resolves through
// focusChild(), so announcing the child here as well reads it twice; make
// sure focusChild() points at the right one before focus-in returns
// instead. (On Windows that resolution needs Qt 6.2 or the focus child
// notification backported into the 5.15 build.)
void accessibilityChildFocused(int index);

// Per-child opt-in for the accessibility action interface (SetFocus /
Expand Down