From 870d7dd40f6dbed141e576b7ddcc26fbd28f919e Mon Sep 17 00:00:00 2001 From: "swan.seo" Date: Thu, 16 Nov 2023 20:22:36 +0900 Subject: [PATCH] Override Offset --- packages/webview_flutter/tizen/src/webview.cc | 16 ++++++++++++++-- packages/webview_flutter/tizen/src/webview.h | 3 +++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/webview_flutter/tizen/src/webview.cc b/packages/webview_flutter/tizen/src/webview.cc index be9a2ec13..27d36bd11 100644 --- a/packages/webview_flutter/tizen/src/webview.cc +++ b/packages/webview_flutter/tizen/src/webview.cc @@ -200,6 +200,14 @@ void WebView::Dispose() { } } +void WebView::Offset(double left, double top) { + left_ = left; + top_ = top; + + evas_object_move(webview_instance_, static_cast(left_), + static_cast(top_)); +} + void WebView::Resize(double width, double height) { width_ = width; height_ = height; @@ -232,8 +240,8 @@ void WebView::Touch(int type, int button, double x, double y, double dx, Eina_List* points = 0; Ewk_Touch_Point* point = new Ewk_Touch_Point; point->id = 0; - point->x = x; - point->y = y; + point->x = x + left_; + point->y = y + top_; point->state = state; points = eina_list_append(points, point); @@ -314,6 +322,10 @@ void WebView::InitWebView() { EwkInternalApiBinding::GetInstance().view.KeyEventsEnabledSet( webview_instance_, true); +#ifdef TV_PROFILE + EwkInternalApiBinding::GetInstance().view.SupportVideoHoleSet(webview_instance_, window_, true, false); +#endif + evas_object_smart_callback_add(webview_instance_, "offscreen,frame,rendered", &WebView::OnFrameRendered, this); evas_object_smart_callback_add(webview_instance_, "load,started", diff --git a/packages/webview_flutter/tizen/src/webview.h b/packages/webview_flutter/tizen/src/webview.h index 380576e12..76eaa25bc 100644 --- a/packages/webview_flutter/tizen/src/webview.h +++ b/packages/webview_flutter/tizen/src/webview.h @@ -35,6 +35,7 @@ class WebView : public PlatformView { virtual void Dispose() override; + virtual void Offset(double left, double top) override; virtual void Resize(double width, double height) override; virtual void Touch(int type, int button, double x, double y, double dx, double dy) override; @@ -85,6 +86,8 @@ class WebView : public PlatformView { flutter::TextureRegistrar* texture_registrar_; double width_ = 0.0; double height_ = 0.0; + double left_ = 0.0; + double top_ = 0.0; void* window_ = nullptr; BufferUnit* working_surface_ = nullptr; BufferUnit* candidate_surface_ = nullptr;