diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp index af91644326..241173070f 100644 --- a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp @@ -235,9 +235,10 @@ void OutOfProcessWebView::notify_server_did_change_title(Badge on_title_change(title); } -void OutOfProcessWebView::notify_server_did_request_scroll(Badge, int wheel_delta) +void OutOfProcessWebView::notify_server_did_request_scroll(Badge, i32 x_delta, i32 y_delta) { - vertical_scrollbar().set_value(vertical_scrollbar().value() + wheel_delta * 20); + horizontal_scrollbar().set_value(horizontal_scrollbar().value() + x_delta); + vertical_scrollbar().set_value(vertical_scrollbar().value() + y_delta); } void OutOfProcessWebView::notify_server_did_request_scroll_into_view(Badge, const Gfx::IntRect& rect) diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.h b/Userland/Libraries/LibWeb/OutOfProcessWebView.h index 7c7c1bdf6f..3eef0e87c1 100644 --- a/Userland/Libraries/LibWeb/OutOfProcessWebView.h +++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.h @@ -57,7 +57,7 @@ public: void notify_server_did_change_selection(Badge); void notify_server_did_request_cursor_change(Badge, Gfx::StandardCursor cursor); void notify_server_did_change_title(Badge, const String&); - void notify_server_did_request_scroll(Badge, int); + void notify_server_did_request_scroll(Badge, i32, i32); void notify_server_did_request_scroll_into_view(Badge, const Gfx::IntRect&); void notify_server_did_enter_tooltip_area(Badge, const Gfx::IntPoint&, const String&); void notify_server_did_leave_tooltip_area(Badge); diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 3fdcf84a90..c8d95ef2ca 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -125,7 +125,7 @@ bool EventHandler::handle_mousewheel(const Gfx::IntPoint& position, unsigned int } if (auto* page = m_frame.page()) { - page->client().page_did_request_scroll(wheel_delta); + page->client().page_did_request_scroll(0, wheel_delta * 20); return true; } diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index 178a7fa4ea..a172a3ace6 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -85,7 +85,7 @@ public: virtual void page_did_invalidate(const Gfx::IntRect&) { } virtual void page_did_change_favicon(const Gfx::Bitmap&) { } virtual void page_did_layout() { } - virtual void page_did_request_scroll(int) { } + virtual void page_did_request_scroll(i32, i32) { } virtual void page_did_request_scroll_into_view(const Gfx::IntRect&) { } virtual void page_did_request_alert(const String&) { } virtual bool page_did_request_confirm(const String&) { return false; } diff --git a/Userland/Libraries/LibWeb/WebContentClient.cpp b/Userland/Libraries/LibWeb/WebContentClient.cpp index b248e32f88..be1fe18082 100644 --- a/Userland/Libraries/LibWeb/WebContentClient.cpp +++ b/Userland/Libraries/LibWeb/WebContentClient.cpp @@ -68,9 +68,9 @@ void WebContentClient::did_change_title(String const& title) m_view.notify_server_did_change_title({}, title); } -void WebContentClient::did_request_scroll(int wheel_delta) +void WebContentClient::did_request_scroll(i32 x_delta, i32 y_delta) { - m_view.notify_server_did_request_scroll({}, wheel_delta); + m_view.notify_server_did_request_scroll({}, x_delta, y_delta); } void WebContentClient::did_request_scroll_into_view(Gfx::IntRect const& rect) diff --git a/Userland/Libraries/LibWeb/WebContentClient.h b/Userland/Libraries/LibWeb/WebContentClient.h index 328b07a66b..a80f325303 100644 --- a/Userland/Libraries/LibWeb/WebContentClient.h +++ b/Userland/Libraries/LibWeb/WebContentClient.h @@ -36,7 +36,7 @@ private: virtual void did_request_cursor_change(i32) override; virtual void did_layout(Gfx::IntSize const&) override; virtual void did_change_title(String const&) override; - virtual void did_request_scroll(int) override; + virtual void did_request_scroll(i32, i32) override; virtual void did_request_scroll_into_view(Gfx::IntRect const&) override; virtual void did_enter_tooltip_area(Gfx::IntPoint const&, String const&) override; virtual void did_leave_tooltip_area() override; diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index ed24af5e82..42bf80e8a6 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -104,9 +104,9 @@ void PageHost::page_did_change_title(const String& title) m_client.async_did_change_title(title); } -void PageHost::page_did_request_scroll(int wheel_delta) +void PageHost::page_did_request_scroll(i32 x_delta, i32 y_delta) { - m_client.async_did_request_scroll(wheel_delta); + m_client.async_did_request_scroll(x_delta, y_delta); } void PageHost::page_did_request_scroll_into_view(const Gfx::IntRect& rect) diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h index d25ee93465..535f862191 100644 --- a/Userland/Services/WebContent/PageHost.h +++ b/Userland/Services/WebContent/PageHost.h @@ -41,7 +41,7 @@ private: virtual void page_did_request_cursor_change(Gfx::StandardCursor) override; virtual void page_did_layout() override; virtual void page_did_change_title(const String&) override; - virtual void page_did_request_scroll(int) override; + virtual void page_did_request_scroll(i32, i32) override; virtual void page_did_request_scroll_into_view(const Gfx::IntRect&) override; virtual void page_did_enter_tooltip_area(const Gfx::IntPoint&, const String&) override; virtual void page_did_leave_tooltip_area() override; diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc index 427cf8c0c9..3a2905ff9a 100644 --- a/Userland/Services/WebContent/WebContentClient.ipc +++ b/Userland/Services/WebContent/WebContentClient.ipc @@ -12,7 +12,7 @@ endpoint WebContentClient did_request_cursor_change(i32 cursor_type) =| did_layout(Gfx::IntSize content_size) =| did_change_title(String title) =| - did_request_scroll(int wheel_delta) =| + did_request_scroll(i32 x_delta, i32 y_delta) =| did_request_scroll_into_view(Gfx::IntRect rect) =| did_enter_tooltip_area(Gfx::IntPoint content_position, String title) =| did_leave_tooltip_area() =|