Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Request cursor change, leave tooltip area, and unhover link only when needed #24039

Closed
wants to merge 2 commits into from

Conversation

ronak69
Copy link
Contributor

@ronak69 ronak69 commented Apr 20, 2024

No description provided.

Before, on *every* mouse-move event, `page_did_request_cursor_change()`
virtual function would get called, requesting to change cursor to the
event's mouse position's cursor.

Now, the page keeps track of the last cursor change that was requested
("page's current cursor") and only requests cursor change again if and
only if the current cursor is not already the one that is required.
Before, on a mouse-move event, if the hovered html element did not have
a tooltip or it was not a link, `page_did_leave_tooltip_area()` and
`page_did_unhover_link()` virtual functions would get called.

Now, the page remembers if it is in a tooltip area or hovering a link
and only informs of leaving or unhovering only if it was.
@github-actions github-actions bot added the 馃憖 pr-needs-review PR needs review from a maintainer or community member label Apr 20, 2024
@ronak69
Copy link
Contributor Author

ronak69 commented Apr 20, 2024

if (paintable->wants_mouse_events()) {
document.set_hovered_node(paintable->dom_node());
if (paintable->handle_mousemove({}, position, buttons, modifiers) == Painting::Paintable::DispatchEventOfSameName::No)
return false;
// FIXME: It feels a bit aggressive to always update the cursor like this.
m_browsing_context->page().client().page_did_request_cursor_change(Gfx::StandardCursor::None);
}

I don't know what this is for. Looks like None cursor is for "default" cursor and not the same as Hidden cursor...

Copy link

stale bot commented May 12, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

@stale stale bot added the stale label May 12, 2024
Copy link

stale bot commented May 22, 2024

This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!

@stale stale bot closed this May 22, 2024
@github-actions github-actions bot removed the 馃憖 pr-needs-review PR needs review from a maintainer or community member label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant