diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-06-05 11:16:13 (GMT) |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-06-08 15:47:22 (GMT) |
commit | 32079bb0b348ef5f7126e69be9bcfb249c1a6412 (patch) | |
tree | 41f760cbf8834923cb0f11e9ac297aa3860beaa4 /src/gui/kernel/qwidget.cpp | |
parent | aad99f4fae89796f7013901344260eb50e4126bb (diff) | |
download | Qt-32079bb0b348ef5f7126e69be9bcfb249c1a6412.zip Qt-32079bb0b348ef5f7126e69be9bcfb249c1a6412.tar.gz Qt-32079bb0b348ef5f7126e69be9bcfb249c1a6412.tar.bz2 |
Avoid bogus accessibility focus events from menus.
Do not send accessibility focus events when menus are involved.
There are focus events to preserve the old focus when showing a new popup window.
Reviewed-by: Jan-Arve
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 434a788..8ca9d8d 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -6427,6 +6427,10 @@ void QWidget::setFocus(Qt::FocusReason reason) if (!(testAttribute(Qt::WA_WState_Created) && window()->windowType() != Qt::Popup && internalWinId())) //setFocusWidget will already post a focus event for us (that the AT client receives) on Windows # endif +# ifdef Q_OS_UNIX + // menus update the focus manually and this would create bogus events + if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem"))) +# endif QAccessible::updateAccessibility(f, 0, QAccessible::Focus); #endif #ifndef QT_NO_GRAPHICSVIEW |