Accessibility Linux: send children changed notifications

The badly named ObjectReorder actually stands for any of this object's
children may have changed. This event is used in webengine and should
trigger the ATs to drop their caches (eg when loading a new website).

Change-Id: I44080f8d43c1161285d9ace4891fe18531f16e09
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
This commit is contained in:
Frederik Gladhorn 2014-07-19 10:02:23 +02:00
parent 01c82b945d
commit 69bec7866b
2 changed files with 17 additions and 1 deletions

View File

@ -910,6 +910,11 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
notifyAboutDestruction(event->accessibleInterface());
break;
}
case QAccessible::ObjectReorder: {
if (sendObject || sendObject_children_changed)
childrenChanged(event->accessibleInterface());
break;
}
case QAccessible::NameChanged: {
if (sendObject || sendObject_property_change || sendObject_property_change_accessible_name) {
QString path = pathForInterface(event->accessibleInterface());
@ -1148,7 +1153,6 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
case QAccessible::TextAttributeChanged:
case QAccessible::TextColumnChanged:
case QAccessible::VisibleDataChanged:
case QAccessible::ObjectReorder:
case QAccessible::SelectionAdd:
case QAccessible::SelectionWithin:
case QAccessible::LocationChanged:
@ -1184,6 +1188,17 @@ void AtSpiAdaptor::sendFocusChanged(QAccessibleInterface *interface) const
}
}
void AtSpiAdaptor::childrenChanged(QAccessibleInterface *interface) const
{
QString parentPath = pathForInterface(interface);
int childCount = interface->childCount();
for (int i = 0; i < interface->childCount(); ++i) {
QString childPath = pathForInterface(interface->child(i));
QVariantList args = packDBusSignalArguments(QLatin1String("add"), childCount, 0, childPath);
sendDBusSignal(parentPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), QLatin1String("ChildrenChanged"), args);
}
}
void AtSpiAdaptor::notifyAboutCreation(QAccessibleInterface *interface) const
{
// // say hello to d-bus

View File

@ -91,6 +91,7 @@ private:
void sendFocusChanged(QAccessibleInterface *interface) const;
void notifyAboutCreation(QAccessibleInterface *interface) const;
void notifyAboutDestruction(QAccessibleInterface *interface) const;
void childrenChanged(QAccessibleInterface *interface) const;
// handlers for the different accessible interfaces
bool applicationInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection);