summaryrefslogtreecommitdiff
path: root/src/gui/kernel/qsoftkeymanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager.cpp')
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 2700bbba25..510705f14e 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() :
@@ -193,6 +190,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);