Re: [mediacapture-screen-share] A CaptureController object for getDisplayMedia() (#230)

> Would this unspecified behavior be identical to point 1?

Unspecified is unspecified, but at least in Chrome's implementation, yes, that's what I intend.

> people might add the controller to use those features only and be surprised by the inadvertent change in focus behavior.

Exactly.

> This seems like a rehash of #190 with all its microtask problems I raised there. Do we really want to go back there?

I don't see an alternative. Or did I misunderstand your mention of user-activation? Do you suggest we *only* use a timer? If so, my problems with that include:
* That seems like it's going to encourage Web-devs to produce buggy code that induces flaky behavior. Namely, they'll call `setFocusBehavior()` from a new task, see that it works on their machine, and fail to realize it flakes out 0.1% of the time. But if we encourage them to call setFocusBehavior("no-focus-change") from the same microtask, their code end up flaking due to the timer far less often.
* When the application fails to call `setFocusBehavior()` at all, the browser will be forced to wait N milliseconds before it performs its default behavior - which is hopefully identical to the existing behavior, which for both Chromium and Firefox happens to be focusing. Users that notice that screenshare ALWAYS produces a 1s delay before focus on a given application, are not going to be happy. (Admittedly, maybe the Web-devs should just do better. If this were my only argument, maybe I'd have relented on this topic.)

> A microtask-sensitive promise-based API sounds terrible

I hope we can agree that `setFocusBehavior()` itself will not return a Promise.
Or may I have misunderstood you on this particular point? If so, please clarify.

> Wouldn't that also preclude use of Capture Handle to answer the focus decision?

Why? `getCaptureHandle()` is synchronous. Or do you mean it won't be possible to talk to a remote server to help drive the decision? I don't think that's a problem, I expect the decision will always be made locally.

> If we go that way, then a callback like @youennf suggested might work.

I'd have to refresh my memory on why we'd ended up backing away from callbacks. But it seems unnecessary. Why is it not simple to specify that `setFocusBehavior()` be called from the very microtask on which gDM's Promise resolves?

-- 
GitHub Notification of comment by eladalon1983
Please view or discuss this issue at https://github.com/w3c/mediacapture-screen-share/issues/230#issuecomment-1235928920 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 2 September 2022 22:05:19 UTC