Hide the context_menu, when the selected text is not displayed.
authorByungJun Kim <bj1987.kim@samsung.com>
Thu, 26 Feb 2015 10:43:43 +0000 (19:43 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
If user scrolls a WebView and selected text gets offscreen,
context_menu doesn't disappear and sometimes overlaps with the URL bar.
Patch adds some logic to hide the context_menu when the selected text
is offscreen.
Reviewed by: Antonio Gomes, DONGJUN KiM, Jaesik Chang

Change-Id: I149be40b35897ff9962f79fe877c277cd3d0dca9
Signed-off-by: ByungJun Kim <bj1987.kim@samsung.com>
tizen_src/impl/context_menu_controller_efl.cc

index 5c48d65..82adaa0 100644 (file)
@@ -404,9 +404,15 @@ bool ContextMenuControllerEfl::ShowContextMenu() {
       return false;
     }
 
+    if ((popup_position.y() - webview_y < webview_y) || (popup_position.x() - webview_x < webview_x))
+        return false;
     int draw_direction;
     CastToSelectionControllerEfl(controller)->ChangeContextMenuPosition(popup_position,
                                                                         draw_direction);
+
+    if ((popup_position.y() > webview_height) || (popup_position.x() > webview_width))
+        return false;
+
     switch(draw_direction) {
       case 0:
         elm_ctxpopup_direction_priority_set(popup_,