[4.0] Fix to get the full input text in RetrieveSurrounding 19/152019/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 22 Sep 2017 07:44:20 +0000 (16:44 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 25 Sep 2017 00:07:22 +0000 (09:07 +0900)
- When an IMF retrieve surround event is received,
 DALi should send the current full text to IME.

Change-Id: Ie00c3de120fd80a54c085ee6bfc138545c938175
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
adaptors/ecore/wayland/imf-manager-impl-ecore-wl.cpp

index e566ab919b34c113e5f0eeb1a2449d02347dc52b..d31c68a7b9b00cfe02d99b6058318cec5180fb99 100644 (file)
@@ -589,16 +589,20 @@ Eina_Bool ImfManager::RetrieveSurrounding( void* data, Ecore_IMF_Context* imfCon
 
   Dali::ImfManager::ImfEventData imfData( Dali::ImfManager::GETSURROUNDING, std::string(), 0, 0 );
   Dali::ImfManager handle( this );
-  mEventSignal.Emit( handle, imfData );
+  Dali::ImfManager::ImfCallbackData callbackData = mEventSignal.Emit( handle, imfData );
 
-  if( text )
+  if( callbackData.update )
   {
-    *text = strdup( mSurroundingText.c_str() );
-  }
+    if( text )
+    {
+      *text = strdup( callbackData.currentText.c_str() );
+    }
 
-  if( cursorPosition )
-  {
-    *cursorPosition = mIMFCursorPosition;
+    if( cursorPosition )
+    {
+      mIMFCursorPosition = static_cast<int>( callbackData.cursorPosition );
+      *cursorPosition = mIMFCursorPosition;
+    }
   }
 
   return EINA_TRUE;