From 01f1e10695216993fe86e35adcecc8115a654beb Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 3 Jul 2014 16:15:21 +0200 Subject: Accessibility Linux: Implement set focus action This is used by Orca for geometric navigation (aka flat review) to move the focus around. It is also generally sensible to be able to programatically move the focus around. This way of moving the focus is redundant with the action interface's focus action. Task-number: QTBUG-40048 Change-Id: I1b61ea843f6bfc3dc00007772e0e5102555ca752 Reviewed-by: Gabriel de Dietrich --- src/platformsupport/linuxaccessibility/atspiadaptor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index 60972af70d..9b76999d17 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -1639,13 +1639,13 @@ bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QSt size << rect.width() << rect.height(); connection.send(message.createReply(size)); } else if (function == QLatin1String("GrabFocus")) { -// FIXME: implement focus grabbing -// if (interface->object() && interface->object()->isWidgetType()) { -// QWidget* w = static_cast(interface->object()); -// w->setFocus(Qt::OtherFocusReason); -// sendReply(connection, message, true); -// } - sendReply(connection, message, false); + QAccessibleActionInterface *actionIface = interface->actionInterface(); + if (actionIface && actionIface->actionNames().contains(QAccessibleActionInterface::setFocusAction())) { + actionIface->doAction(QAccessibleActionInterface::setFocusAction()); + sendReply(connection, message, true); + } else { + sendReply(connection, message, false); + } } else if (function == QLatin1String("SetExtents")) { // int x = message.arguments().at(0).toInt(); // int y = message.arguments().at(1).toInt(); -- cgit v1.2.3