diff options
author | axis <qt-info@nokia.com> | 2009-11-12 12:31:54 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-11-12 12:31:54 (GMT) |
commit | 79f8639e183371d0c7cdf30c50387f019f0561ac (patch) | |
tree | 68922424d98edc67a5c061b34419e06957ad3d94 /src/gui/kernel | |
parent | 0779fbb16838a5d857665a0d70e30e2ba49cefba (diff) | |
parent | 42d990bde3ea5e825d90d245a958c7faf7a6aa5b (diff) | |
download | Qt-79f8639e183371d0c7cdf30c50387f019f0561ac.zip Qt-79f8639e183371d0c7cdf30c50387f019f0561ac.tar.gz Qt-79f8639e183371d0c7cdf30c50387f019f0561ac.tar.bz2 |
Merge branch 'focusOutBug' into 4.6
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 26 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 5 |
2 files changed, 28 insertions, 3 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 5578a72..dd2ccf2 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -319,7 +319,12 @@ void QLongTapTimer::RunL() } QSymbianControl::QSymbianControl(QWidget *w) - : CCoeControl(), qwidget(w), m_ignoreFocusChanged(false) + : CCoeControl() + , qwidget(w) + , m_longTapDetector(0) + , m_ignoreFocusChanged(0) + , m_previousEventLongTap(0) + , m_symbianPopupIsOpen(0) { } @@ -911,6 +916,15 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) return; if (IsFocused() && IsVisible()) { + if (m_symbianPopupIsOpen) { + QWidget *fw = QApplication::focusWidget(); + if (fw) { + QFocusEvent event(QEvent::FocusIn, Qt::PopupFocusReason); + QCoreApplication::sendEvent(fw, &event); + } + m_symbianPopupIsOpen = false; + } + QApplication::setActiveWindow(qwidget->window()); #ifdef Q_WS_S60 // If widget is fullscreen, hide status pane and button container @@ -924,6 +938,16 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) buttonGroup->MakeVisible(!isFullscreen); #endif } else if (QApplication::activeWindow() == qwidget->window()) { + if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) { + QWidget *fw = QApplication::focusWidget(); + if (fw) { + QFocusEvent event(QEvent::FocusOut, Qt::PopupFocusReason); + QCoreApplication::sendEvent(fw, &event); + } + m_symbianPopupIsOpen = true; + return; + } + QApplication::setActiveWindow(0); } // else { We don't touch the active window unless we were explicitly activated or deactivated } diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index a1e760c..d45c34a 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -202,9 +202,10 @@ private: private: QWidget *qwidget; - bool m_ignoreFocusChanged; QLongTapTimer* m_longTapDetector; - bool m_previousEventLongTap; + bool m_ignoreFocusChanged : 1; + bool m_previousEventLongTap : 1; + bool m_symbianPopupIsOpen : 1; #ifdef Q_WS_S60 // Fader object used to fade everything except this menu and the CBA. |