javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttextbase.cpp
branchRCL_3
changeset 18 9ac0a0a7da70
parent 14 04becd199f91
child 19 71c436fe3ce0
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttextbase.cpp	Tue May 11 16:07:20 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttextbase.cpp	Tue May 25 12:34:19 2010 +0300
@@ -48,7 +48,6 @@
 //
 CSwtTextBase::~CSwtTextBase()
 {
-    iEikonEnv->SyncNotifyFocusObserversOfChangeInFocus();
     // Own
     delete iEditor;
     iEditor = NULL;
@@ -910,35 +909,29 @@
 //
 void CSwtTextBase::FocusChanged(TDrawNow aDrawNow)
 {
-    TBool isFocused = IsFocused();
-
     if (iEditor)
     {
         TRAP_IGNORE(iEditor->UpdateScrollBarsL());
     }
 
-    if (!isFocused)
+    if (iEditor)
     {
-        if (iEditor)
+        if (iIndicator)
         {
-            iEditor->SetFocus(IsFocused());
-
-            if (iIndicator)
-            {
+            if (!IsFocused())
                 iIndicator->SetState(EStateNone);
-            }
         }
+        
+        // Aparenlty this is the only way of forcing the VKB to close.
+        if (iEditor->IsFocused() && !IsFocused())
+        {
+            iDisplay.CoeEnv()->Fep()->HandleDestructionOfFocusedItem();
+        }
+        
+        iEditor->SetFocus(IsFocused());
     }
 
     HandleFocusChanged(aDrawNow);
-
-    if (isFocused)
-    {
-        if (iEditor)
-        {
-            iEditor->SetFocus(IsFocused());
-        }
-    }
 }
 
 // ---------------------------------------------------------------------------