diff options
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager.cpp')
-rw-r--r-- | src/gui/kernel/qsoftkeymanager.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 80e6ec6..9caa37e 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -48,16 +48,13 @@ #ifdef Q_WS_S60 #include "private/qsoftkeymanager_s60_p.h" -#endif - -#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2) #include "private/qt_s60_p.h" #endif #ifndef QT_NO_SOFTKEYMANAGER QT_BEGIN_NAMESPACE -QSoftKeyManager *QSoftKeyManagerPrivate::self = 0; +QScopedPointer<QSoftKeyManager> QSoftKeyManagerPrivate::self(0); QString QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey) { @@ -88,9 +85,9 @@ QString QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey) QSoftKeyManager *QSoftKeyManager::instance() { if (!QSoftKeyManagerPrivate::self) - QSoftKeyManagerPrivate::self = new QSoftKeyManager; + QSoftKeyManagerPrivate::self.reset(new QSoftKeyManager); - return QSoftKeyManagerPrivate::self; + return QSoftKeyManagerPrivate::self.data(); } QSoftKeyManager::QSoftKeyManager() : @@ -203,6 +200,11 @@ void QSoftKeyManager::sendKeyEvent() void QSoftKeyManager::updateSoftKeys() { +#ifdef Q_WS_S60 + // Do not adjust softkeys if application is not the topmost one + if (S60->wsSession().GetFocusWindowGroup() != S60->windowGroup().WindowGroupId()) + return; +#endif QSoftKeyManager::instance()->d_func()->pendingUpdate = true; QEvent *event = new QEvent(QEvent::UpdateSoftKeys); QApplication::postEvent(QSoftKeyManager::instance(), event); |