Fix bad hardware back key behavior.
authorMichał Obrembski <m.obrembski@samsung.com>
Thu, 12 Jun 2014 13:47:50 +0000 (15:47 +0200)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
On mobile, when context menu is shown, and user presses hardware back
key, browser opens previous site instead of closing menu.
This commit fixes this issue.

Issue-Id: CBBROWSER-76
Change-Id: Ic336dbd2ca63c847c87bc092b391af90e32437e2

tizen_src/impl/eweb_view.cc

index 09b728bac00b679770ed36a4f6aec6f5c7ebe959..8ad425148ccecef6124951e78c093da6c59ca1be 100755 (executable)
@@ -773,15 +773,19 @@ Eina_Bool EWebView::handleKeyDown(Ewk_View_Smart_Data* d, const Evas_Event_Key_D
       webview->context_menu_.reset();
       handled = true;
     }
-    if (webview->selection_controller_->IsAnyHandleVisible()){
+    if (webview->selection_controller_->IsAnyHandleVisible()) {
       DVLOG(1) << "Clearing text selection due to back key press";
       webview->ClearSelection();
       handled = true;
     }
+#ifndef OS_TIZEN_TV
+    if (!handled)
+      webview->GoBack();
+#endif
+    return EINA_TRUE;
   }
-  if (!handled)
-    webview->rwhv()->HandleEvasEvent(event);
-  return true;
+  webview->rwhv()->HandleEvasEvent(event);
+  return EINA_TRUE;
 }
 
 Eina_Bool EWebView::handleKeyUp(Ewk_View_Smart_Data* d, const Evas_Event_Key_Up* event) {