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

LibWeb: Support setting the cursor in OutOfProcessWebView

This commit is contained in:
Adam Hodgen 2021-02-27 21:12:12 +00:00 committed by Andreas Kling
parent fc9225db33
commit bedcd9cd88
7 changed files with 23 additions and 0 deletions

View file

@ -229,6 +229,11 @@ void OutOfProcessWebView::notify_server_did_change_selection(Badge<WebContentCli
request_repaint();
}
void OutOfProcessWebView::notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor)
{
set_override_cursor(cursor);
}
void OutOfProcessWebView::notify_server_did_layout(Badge<WebContentClient>, const Gfx::IntSize& content_size)
{
set_content_size(content_size);

View file

@ -58,6 +58,7 @@ public:
void notify_server_did_paint(Badge<WebContentClient>, i32 bitmap_id);
void notify_server_did_invalidate_content_rect(Badge<WebContentClient>, const Gfx::IntRect&);
void notify_server_did_change_selection(Badge<WebContentClient>);
void notify_server_did_request_cursor_change(Badge<WebContentClient>, Gfx::StandardCursor cursor);
void notify_server_did_change_title(Badge<WebContentClient>, const String&);
void notify_server_did_request_scroll_into_view(Badge<WebContentClient>, const Gfx::IntRect&);
void notify_server_did_hover_link(Badge<WebContentClient>, const URL&);

View file

@ -74,6 +74,15 @@ void WebContentClient::handle(const Messages::WebContentClient::DidChangeSelecti
m_view.notify_server_did_change_selection({});
}
void WebContentClient::handle(const Messages::WebContentClient::DidRequestCursorChange& message)
{
if (message.cursor_type() < 0 || message.cursor_type() >= (i32)Gfx::StandardCursor::__Count) {
dbgln("DidRequestCursorChange: Bad cursor type");
return;
}
m_view.notify_server_did_request_cursor_change({}, (Gfx::StandardCursor)message.cursor_type());
}
void WebContentClient::handle(const Messages::WebContentClient::DidLayout& message)
{
dbgln_if(SPAM_DEBUG, "handle: WebContentClient::DidLayout! content_size={}", message.content_size());

View file

@ -54,6 +54,7 @@ private:
virtual void handle(const Messages::WebContentClient::DidFinishLoading&) override;
virtual void handle(const Messages::WebContentClient::DidInvalidateContentRect&) override;
virtual void handle(const Messages::WebContentClient::DidChangeSelection&) override;
virtual void handle(const Messages::WebContentClient::DidRequestCursorChange&) override;
virtual void handle(const Messages::WebContentClient::DidLayout&) override;
virtual void handle(const Messages::WebContentClient::DidChangeTitle&) override;
virtual void handle(const Messages::WebContentClient::DidRequestScrollIntoView&) override;