Skip to content

When the Servo window gains focus, it should update the mouse coordinate #11130

@paulrouget

Description

@paulrouget

This is important for browserhtml. We need this to build automated tests.

in ports/glutin, the mouse coordinate is updated when receiving a glutin mousemove event.

When Servo starts, as the mouse moves, mouse_pos is updated. Then Servo loses focus. User moves the mouse. When Servo gains focus, the mouse is likely not at mouse_pos anymore. That means:

  1. mouseover is not triggered and :hover styles are not applied for element below the mouse
  2. if a click occurs before the mouse is moved, the clicked is triggered for the element that was under the latest known coordinate (right before losing focus)

We should update mouse_pos when gaining focus, and fire a mousemove event if it changed.

There is a Focused(bool) glutin event, but it doesn't come with new mouse coordinates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-gfx/compositingC-assignedThere is someone working on resolving the issueC-has-open-prThere is a PR open that resolves the issueE-less-complexStraightforward. Recommended for a new contributor.P-macAny version of MacOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions