summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-06-05 04:16:13 -0700
committerQt by Nokia <qt-info@nokia.com>2011-08-18 15:50:50 +0200
commit5af6a09b6faf55bf70237913f49dcf4ba2358f52 (patch)
treeb9bc11af4fe33241f12d6490dbc9fdd9892cc81e
parent8d16fcb912778c7d881ab735f2180dcb7081bb91 (diff)
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 (cherry picked from commit 32079bb0b348ef5f7126e69be9bcfb249c1a6412) Change-Id: Id4838a3aede1d60a1850385e97660d085f055d64 Reviewed-on: http://codereview.qt.nokia.com/3021 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
-rw-r--r--src/gui/kernel/qwidget.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 60f20644c7..231fc261d7 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -6444,6 +6444,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