From 9053e24a25076a2a35bff41c56b2c770c8cdf064 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Wed, 22 Feb 2023 08:15:01 +0530 Subject: [PATCH] [M108 Migration] Add "custom,scroll,begin","custom,scroll,end" support Handles and context menu should be temporarily hidden durnig scrolling. But specific applications like email-app uses their own scrolling mechanism within chromium-efl does not know about this happening. This breaks chromium-EFL behaviour. To meet these requirements email-app provided smart callbacks to notify engine that custom scrolling is started and finished. The patch is a counterpart of above smart callbacks. Reference: https://review.tizen.org/gerrit/281741 Change-Id: I5ab6d978b50b4e9ed4302ad28fcc65f1c248453b Signed-off-by: Ayush Kumar --- tizen_src/ewk/efl_integration/eweb_view.cc | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index 4638300..5d6f3a4 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -115,6 +115,12 @@ static const char* kRendererCrashedHTMLMessage = // that the web view is only partially visible. static const char* kVisibleContentChangedSignalName = "visible,content,changed"; +// email-app specific signal which informs that custom scrolling is started. +const char* kCustomScrollBeginSignalName = "custom,scroll,begin"; + +// email-app specific signal which informs that custom scrolling is finished. +const char* kCustomScrollEndSignalName = "custom,scroll,end"; + inline void SetDefaultStringIfNull(const char*& variable, const char* default_string) { if (!variable) { @@ -284,15 +290,17 @@ void EWebView::VisibleContentChangedCallback(void* user_data, void EWebView::OnCustomScrollBeginCallback(void* user_data, Evas_Object* /*object*/, void* /*event_info*/) { - auto view = static_cast(user_data); - view->GetSelectionController()->SetControlsTemporarilyHidden(true, true); + auto* view = static_cast(user_data); + if (auto* selection_controller = view->GetSelectionController()) + selection_controller->SetControlsTemporarilyHidden(true,true); } void EWebView::OnCustomScrollEndCallback(void* user_data, Evas_Object* /*object*/, void* /*event_info*/) { - auto view = static_cast(user_data); - view->GetSelectionController()->SetControlsTemporarilyHidden(false, true); + auto* view = static_cast(user_data); + if (auto* selection_controller = view->GetSelectionController()) + selection_controller->SetControlsTemporarilyHidden(false,true); } EWebView::EWebView(Ewk_Context* context, Evas_Object* object) @@ -314,6 +322,10 @@ EWebView::EWebView(Ewk_Context* context, Evas_Object* object) kVisibleContentChangedSignalName, VisibleContentChangedCallback, this); + evas_object_smart_callback_add(evas_object_, kCustomScrollBeginSignalName, + OnCustomScrollBeginCallback, this); + evas_object_smart_callback_add(evas_object_, kCustomScrollEndSignalName, + OnCustomScrollEndCallback, this); evas_object_event_callback_add(evas_object_, EVAS_CALLBACK_FOCUS_IN, OnViewFocusIn, this); evas_object_event_callback_add(evas_object_, EVAS_CALLBACK_FOCUS_OUT, @@ -445,6 +457,10 @@ EWebView::~EWebView() { evas_object_smart_callback_del(evas_object_, kVisibleContentChangedSignalName, VisibleContentChangedCallback); + evas_object_smart_callback_del(evas_object_, kCustomScrollBeginSignalName, + OnCustomScrollBeginCallback); + evas_object_smart_callback_del(evas_object_, kCustomScrollEndSignalName, + OnCustomScrollEndCallback); } } -- 2.7.4