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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the desired behavior for capturing the cursor? #38

Open
eladalon1983 opened this issue Dec 4, 2023 · 3 comments
Open

What is the desired behavior for capturing the cursor? #38

eladalon1983 opened this issue Dec 4, 2023 · 3 comments

Comments

@eladalon1983
Copy link
Contributor

What is the desired behavior for capturing the cursor?

IMHO, the cursor should:

  1. Only be visible in the captured video frames when the cursor over the target-element's bounding box. (Henceforth: TEBB.)
  2. When the cursor only partially intersects with the TEBB, the captured portion of the cursor should match the intersection with the TEBB.
  3. When the cursor is over the TEBB, the cursor should always be captured, even if there are (from a z-order perspective) intervening elements in between the target-element and the cursor.
  4. The cursor should always be drawn at the same offset to the TEBB as the user observes on their screen.
@markafoltz
Copy link
Collaborator

This seems reasonable to me.

However, as observed in Chrome, the cursor is painted separately from the content, typically by the underlying OS; and has to be re-rendered on top of the captured frame before delivery to consumers. The process of capturing the cursor position and re-rendering it is async from the rendering and capture of the element, so the captured element + cursor in the media stream will not match exactly what is rendered on-screen.

@eladalon1983
Copy link
Contributor Author

eladalon1983 commented Sep 18, 2024

Under normal conditions[*], I'd expect the discrepancy to be small wrt coordinates delta, short wrt time, privacy-trivial, and not impactful wrt usability. I could add the original proposal to the spec, but use SHOULD rather than MUST, then clarify with a note the possibility of discrepancies due to implementation inaccuracy. Wdyt?

--
[*] I.e. real human being operating a reasonable mouse, as opposed to software intentionally snapping the cursor around at high speed.

@markafoltz
Copy link
Collaborator

Yes, the discrepancy should be small, but could be noticeable when e.g. dragging an element around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants