summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-03 16:15:21 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-04 08:58:42 +0200
commit01f1e10695216993fe86e35adcecc8115a654beb (patch)
tree9a0bec8cf5dc1dfca15a092e9d7f4d7feaaafc06 /src/platformsupport
parent9c79f6dfb3b5724b52421f74fbee6f5c0005d0e3 (diff)
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 <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp14
1 files changed, 7 insertions, 7 deletions
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<QWidget*>(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();