From ebc92dee930424a6889ab5a64f2dc317b547f9b9 Mon Sep 17 00:00:00 2001 From: Alex Studer Date: Wed, 3 Jul 2024 15:49:52 -0400 Subject: [PATCH] Android: Provide viewport_size instead of viewport_rect This updates the Android WebViewImplementationNative to match changes made in commit 5285e22f2aa09152365179865f135e7bc5d254a5. We remove the async_set_viewport_rect call because the parent ViewImplementation::handle_resize call does that for us. --- Ladybird/Android/src/main/cpp/WebViewImplementationNative.cpp | 3 +-- Ladybird/Android/src/main/cpp/WebViewImplementationNative.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Ladybird/Android/src/main/cpp/WebViewImplementationNative.cpp b/Ladybird/Android/src/main/cpp/WebViewImplementationNative.cpp index 624f612d703..dd5c12e15cb 100644 --- a/Ladybird/Android/src/main/cpp/WebViewImplementationNative.cpp +++ b/Ladybird/Android/src/main/cpp/WebViewImplementationNative.cpp @@ -93,8 +93,7 @@ void WebViewImplementationNative::paint_into_bitmap(void* android_bitmap_raw, An void WebViewImplementationNative::set_viewport_geometry(int w, int h) { - m_viewport_rect = { { 0, 0 }, { w, h } }; - client().async_set_viewport_rect(0, m_viewport_rect); + m_viewport_size = { w, h }; handle_resize(); } diff --git a/Ladybird/Android/src/main/cpp/WebViewImplementationNative.h b/Ladybird/Android/src/main/cpp/WebViewImplementationNative.h index 224a5da83d4..dfbe3f195b9 100644 --- a/Ladybird/Android/src/main/cpp/WebViewImplementationNative.h +++ b/Ladybird/Android/src/main/cpp/WebViewImplementationNative.h @@ -15,7 +15,7 @@ class WebViewImplementationNative : public WebView::ViewImplementation { public: WebViewImplementationNative(jobject thiz); - virtual Web::DevicePixelRect viewport_rect() const override { return m_viewport_rect; } + virtual Web::DevicePixelSize viewport_size() const override { return m_viewport_size; } virtual Gfx::IntPoint to_content_position(Gfx::IntPoint p) const override { return p; } virtual Gfx::IntPoint to_widget_position(Gfx::IntPoint p) const override { return p; } virtual void update_zoom() override { } @@ -38,6 +38,6 @@ public: private: jobject m_java_instance = nullptr; - Web::DevicePixelRect m_viewport_rect; + Web::DevicePixelSize m_viewport_size; }; }