-
Notifications
You must be signed in to change notification settings - Fork 25
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
No easy way to listen to changes to all screen attributes #51
Comments
IIUC, this feedback was echoed (plus coalescing) by another partner testing the API:
We should indeed try to coalesce more screen change events, but it's not always plausible; e.g. making one display bigger or smaller may cause the OS/WM to move the other displays to keep them adjacent, etc. See this logging example: screensInterface.screens[0].addEventListener('change', (e) => { const s = e.target; console.log( // I changed display 0's resolution: Windows itself seems to cause display flickering as it updates the scaling and taskbar dimensions of each display, which is unfortunate, and other OSes have similar jank. We should strive to coalesce events that occur in rapid succession for each display, but even then, we'd still have one event for each display here, which seems correct, given the final per-screen changes that occur. IIUC, you might like a single event to be fired when any display's attributes change, which would need to coalesce events that occur for any display in rapid succession. Both types of coalescing can be poly-filled and tuned to the needs of the individual site, but this might be a reasonable request. See also http://crbug.com/1077367 |
Feedback from @cterefinko.
There is an event listener for hearing about the set of screens or changing, and there are individual event listeners per screen to find out about attribute changes. However, to hear about the set of changes to all screen attributes, listeners have to be attached/removed from all screens as they become available.
There wasn't a particular use case in mind here that this is blocking, but is just more general feedback for the api that should be considered.
The text was updated successfully, but these errors were encountered: