Fix for focus issue
authorhyun lee <hyunn.lee@samsung.com>
Wed, 11 Sep 2013 04:51:09 +0000 (13:51 +0900)
committerhyun lee <hyunn.lee@samsung.com>
Wed, 11 Sep 2013 04:51:09 +0000 (13:51 +0900)
Change-Id: I8593faaed280e5b719b47e8192e2df63c926192d
Signed-off-by: hyun lee <hyunn.lee@samsung.com>
src/controls/FWebCtrl_WebImpl.cpp

index 2b78f55..8a90585 100755 (executable)
@@ -1759,11 +1759,6 @@ OnWindowObjectFocusGained(void* pUserData, Evas_Object* pWin, void* pEvent_info)
 
                if (pImpl->IsWinFocusLost() == true)
                {
-                       if (pImpl->IsKeypadOpened() == true)
-                       {
-                               evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
-                       }
-
                        Ewk_Settings* pSettings = ewk_view_settings_get(pWebCore->GetWebNativeNode());
                        SysAssertf(pSettings, "Failed to get settings instance.");
 
@@ -1773,6 +1768,10 @@ OnWindowObjectFocusGained(void* pUserData, Evas_Object* pWin, void* pEvent_info)
 
                                evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
                        }
+                       else if (pImpl->IsKeypadOpened() == true)
+                       {
+                               evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE);
+                       }
                }
        }
 
@@ -1799,11 +1798,17 @@ OnWebNativeNodeFocusLost(void* pUserData, Evas* pCanvas, Evas_Object* pView, voi
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        SysAssertf(pImpl, "Failed to request");
 
-       if (pImpl->IsWinFocusLost() == true)
-       {
-               _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
-               SysAssertf(pWebCore, "Failed to get Web core object");
+       _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore()));
+       SysAssertf(pWebCore, "Failed to get Web core object");
+
+       Eina_Rectangle leftHandle;
+       Eina_Rectangle rightHandle;
 
+       EINA_RECTANGLE_SET(&leftHandle, 0, 0, 0, 0);
+       EINA_RECTANGLE_SET(&rightHandle, 0, 0, 0, 0);
+
+       if (pImpl->IsWinFocusLost() == true && ewk_view_text_selection_range_get(pWebCore->GetWebNativeNode(), &leftHandle, &rightHandle))
+       {
                Ewk_Settings* pSettings = ewk_view_settings_get(pWebCore->GetWebNativeNode());
                SysAssertf(pSettings, "Failed to get settings instance.");