Fixed wrong behaviors with HW back button.
authorSanghyup Lee <sh53.lee@samsung.com>
Wed, 2 Dec 2015 22:25:58 +0000 (07:25 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
1. If IME is shown, context menu and handlers shouldn't be hidden by H/W back
key. Currently context menu and handlers are cleared regardless of IME state
becuase |SelectionControllerEfl::HideHandleAndContextMenu()| is called in
|RWHVEfl::ImeCompositionRangeChanged| which is called when IME is shown or
hidden. This patch removes it.

2. HW back key deletes selected text. |IMContextEfl::OnPreeditChanged| isn't
returned propery when buffer is empty.

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=15025
Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=15060

Reviewed by: a1.gomes, djmix.kim, g.czajkowski

Change-Id: If85f59f0121cf36159e4b5d0ea9adda6a9df78d6
Signed-off-by: Sanghyup Lee <sh53.lee@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/im_context_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc

index 61eceab..a6940c3 100755 (executable)
@@ -409,8 +409,14 @@ void IMContextEfl::OnPreeditChanged(void* data, Ecore_IMF_Context* context, void
   char* buffer = 0;
 
   ecore_imf_context_preedit_string_get(context, &buffer, 0);
-  if (!buffer)
-      return;
+
+  // Upon the BACK HW key press on Mobile, the preedit changed
+  // registered callback is being called with an empty preedit string.
+  // This bubbles down to the engine through RWHVEfl::SetComposition
+  // and ends up deleting selected text, if any. Check here prevents this
+  // from happening.
+  if (!buffer || !strcmp(buffer, ""))
+    return;
 
   utf8_key_ = buffer;
   // Add empty commit to stop processing commits.
index 308565a..2966e0a 100755 (executable)
@@ -853,9 +853,7 @@ void RenderWidgetHostViewEfl::ImeCancelComposition() {
 void RenderWidgetHostViewEfl::ImeCompositionRangeChanged(
   const gfx::Range& range,
   const std::vector<gfx::Rect>& character_bounds) {
-
-  if (GetSelectionController())
-    GetSelectionController()->HideHandleAndContextMenu();
+  NOTIMPLEMENTED();
 }
 
 void RenderWidgetHostViewEfl::FocusedNodeChanged(bool is_editable_node) {