1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 10:07:35 +00:00

Ladybird+LibWebView: Migrate cursor changes to LibWebView callbacks

This commit is contained in:
Timothy Flynn 2023-08-23 10:43:27 -04:00 committed by Tim Flynn
parent bf464665a7
commit 00fe122b0a
9 changed files with 14 additions and 20 deletions

View file

@ -88,6 +88,10 @@ WebContentView::WebContentView(StringView webdriver_content_ipc_path, WebView::E
on_ready_to_paint = [this]() {
viewport()->update();
};
on_cursor_change = [this](auto cursor) {
update_cursor(cursor);
};
}
WebContentView::~WebContentView() = default;
@ -600,7 +604,7 @@ void WebContentView::create_client(WebView::EnableCallgrindProfiling enable_call
client().async_connect_to_webdriver(m_webdriver_content_ipc_path);
}
void WebContentView::notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor)
void WebContentView::update_cursor(Gfx::StandardCursor cursor)
{
switch (cursor) {
case Gfx::StandardCursor::Hidden:

View file

@ -76,7 +76,6 @@ public:
};
void update_palette(PaletteMode = PaletteMode::Default);
virtual void notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor) override;
virtual void notify_server_did_request_scroll(Badge<WebContentClient>, i32, i32) override;
virtual void notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint) override;
virtual void notify_server_did_request_scroll_into_view(Badge<WebContentClient>, Gfx::IntRect const&) override;
@ -96,6 +95,7 @@ private:
virtual Gfx::IntPoint to_widget_position(Gfx::IntPoint content_position) const override;
void update_viewport_rect();
void update_cursor(Gfx::StandardCursor cursor);
qreal m_inverse_pixel_scaling_ratio { 1.0 };
bool m_should_show_line_box_borders { false };