src/hbcore/inputfw/hbinputcontextproxy.cpp
changeset 7 923ff622b8b9
parent 6 c3690ec91ef8
child 21 4633027730f5
child 34 ed14f46c0e55
--- a/src/hbcore/inputfw/hbinputcontextproxy.cpp	Wed Jun 23 18:33:25 2010 +0300
+++ b/src/hbcore/inputfw/hbinputcontextproxy.cpp	Tue Jul 06 14:36:53 2010 +0300
@@ -98,6 +98,10 @@
         if (!widget) {
             mTarget->setFocusObject(0);
         } else if (HbInputFocusObject::isEditor(widget) && !HbInputFocusObject::isReadOnlyWidget(widget)) {
+            if (mTarget->focusObject() && mTarget->focusObject()->object() == widget) {
+                // Already focused to given widget.                 
+                return;
+            } 
             mTarget->setFocusObject(new HbInputFocusObject(widget));
         }
     }
@@ -110,12 +114,11 @@
 bool HbInputContextProxy::filterEvent(const QEvent *event)
 {
     if (mTarget) {
-#if QT_VERSION >= 0x040600
         bool orientationCompleted = HbInputSettingProxy::instance()->orientationChangeCompleted();
         if (event->type() == QEvent::CloseSoftwareInputPanel && orientationCompleted) {
             setInputFrameworkFocus(0);
             return true;
-        } else if (event->type() == QEvent::RequestSoftwareInputPanel && orientationCompleted) {           
+        } else if (event->type() == QEvent::RequestSoftwareInputPanel && orientationCompleted) {
             if (QWidget *focusedWidget =  qApp->focusWidget()) {
                 // see if the focused widget is graphics view, if so get the focused graphics item in the view
                 // and acivate inputmethod for the focused graphics item
@@ -138,7 +141,6 @@
             }
             return true;
         }
-#endif
 
 #ifdef Q_OS_SYMBIAN
         const quint32 HbInputContextProxyExternalKeyboardModifier = 0x00200000;