This commit moves the focus to the message of newly shown passive
messages when accessibility software is used. Moving focus to an
object generally means that it will be announced, so this makes
sure that users of accessibility software know when they are being
notified of a change.
#include <KShell>
#include <kio_version.h>
+#ifndef QT_NO_ACCESSIBILITY
+#include <QAccessible>
+#endif
#include <QApplication>
#include <QDesktopServices>
#include <QDropEvent>
m_messageWidget->hide();
}
m_messageWidget->animatedShow();
+
+#ifndef QT_NO_ACCESSIBILITY
+ if (QAccessible::isActive() && isActive()) {
+ // To announce the new message keyboard focus must be moved to the message label. However, we do not have direct access to the label that is internal
+ // to the KMessageWidget. Instead we setFocus() on the KMessageWidget and trust that it has set correct focus handling.
+ m_messageWidget->setFocus();
+ }
+#endif
}
void DolphinViewContainer::readSettings()