summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorJani Hautakangas <jani.hautakangas@nokia.com>2011-07-05 00:11:09 +0300
committerJani Hautakangas <jani.hautakangas@nokia.com>2011-07-05 00:11:09 +0300
commitc018f01b8a97e9ae3dee12777fd1bde4c51f231e (patch)
tree622fe32e3fde6cfa1e356a1349511749fb0870fc /src/gui/inputmethod
parent73d7fdf686c05adaf0ea8ecddfb264b7741a2e6a (diff)
parent0a5d51aaf95524d6c5933404f0e5ab9b331d4084 (diff)
Merge remote branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts: doc/src/external-resources.qdoc src/gui/text/qtextlayout.cpp src/opengl/qwindowsurface_gl.cpp
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp59
1 files changed, 41 insertions, 18 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index f8d7e28387..5fe25b2f33 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -54,6 +54,7 @@
#include <fepitfr.h>
#include <hal.h>
+#include <e32property.h>
#include <limits.h>
// You only find these enumerations on SDK 5 onwards, so we need to provide our own
@@ -72,6 +73,10 @@
// EAknEditorFlagEnablePartialScreen is only valid from Sym^3 onwards.
#define QT_EAknEditorFlagEnablePartialScreen 0x200000
+// Properties to detect VKB status from AknFepInternalPSKeys.h
+#define QT_EPSUidAknFep 0x100056de
+#define QT_EAknFepTouchInputActive 0x00000004
+
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable)
@@ -312,28 +317,46 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
return false;
if (event->type() == QEvent::RequestSoftwareInputPanel) {
- // Notify S60 that we want the virtual keyboard to show up.
- QSymbianControl *sControl;
- sControl = focusWidget()->effectiveWinId()->MopGetObject(sControl);
- Q_ASSERT(sControl);
-
- // The FEP UI temporarily steals focus when it shows up the first time, causing
- // all sorts of weird effects on the focused widgets. Since it will immediately give
- // back focus to us, we temporarily disable focus handling until the job's done.
- if (sControl) {
- sControl->setIgnoreFocusChanged(true);
+ // Only request virtual keyboard if it is not yet active or if this is the first time
+ // panel is requested for this application.
+ static bool firstTime = true;
+ int vkbActive = 0;
+
+ if (firstTime) {
+ // Sometimes the global QT_EAknFepTouchInputActive value can be left incorrect at
+ // application exit if the application is exited when input panel is active.
+ // Therefore we always want to open the panel the first time application requests it.
+ firstTime = false;
+ } else {
+ const TUid KPSUidAknFep = {QT_EPSUidAknFep};
+ // No need to check for return value, as vkbActive stays zero in that case
+ RProperty::Get(KPSUidAknFep, QT_EAknFepTouchInputActive, vkbActive);
}
- ensureInputCapabilitiesChanged();
- m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::QT_EAknActivatePenInputRequest);
+ if (!vkbActive) {
+ // Notify S60 that we want the virtual keyboard to show up.
+ QSymbianControl *sControl;
+ sControl = focusWidget()->effectiveWinId()->MopGetObject(sControl);
+ Q_ASSERT(sControl);
+
+ // The FEP UI temporarily steals focus when it shows up the first time, causing
+ // all sorts of weird effects on the focused widgets. Since it will immediately give
+ // back focus to us, we temporarily disable focus handling until the job's done.
+ if (sControl) {
+ sControl->setIgnoreFocusChanged(true);
+ }
+
+ ensureInputCapabilitiesChanged();
+ m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::QT_EAknActivatePenInputRequest);
- if (sControl) {
- sControl->setIgnoreFocusChanged(false);
+ if (sControl) {
+ sControl->setIgnoreFocusChanged(false);
+ }
+ //If m_pointerHandler has already been set, it means that fep inline editing is in progress.
+ //When this is happening, do not filter out pointer events.
+ if (!m_pointerHandler)
+ return true;
}
- //If m_pointerHandler has already been set, it means that fep inline editing is in progress.
- //When this is happening, do not filter out pointer events.
- if (!m_pointerHandler)
- return true;
}
return false;