You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// A little bit of magic to detect if already fullscreen, translated from:// https://stackoverflow.com/questions/2863351/checking-if-browser-is-in-fullscreenlet is_fullscreen = {let screen_top = window().screen().and_then(|s| s.top()).map(|top| JsValue::from(top)).map(|v| v.is_falsy());let screen_y = window().screen_y().map(|v| v.is_falsy());iflet(Ok(true),Ok(true)) = (screen_top, screen_y){true}else{false}};
Drawbacks, Rationale, and Alternatives
Does this design have drawbacks? Are there alternative approaches? Why is this
design the best of all designs available?
This is compatible for all browsers (according to the stack overflow article)
What prior art exists?
Not sure
Unresolved Questions
What is not clear yet? What do we expect to clarify through implementation
and/or usage experience?
I'm not sure where this would fit, API wise. Perhaps in gloo-utils.
My proposal would be to add gloo_utils::screen which is short for gloo_utils::window().screen(). This could provide a wrapped Screen which mirrors the inner, while providing additional functions such as is_fullscreen().
The text was updated successfully, but these errors were encountered:
Summary
We have the ability to
Element::request_fullscreen
, but no way to detect it.This makes it hard to show/hide a fullscreen button.
Goal: Add a sugar function to detect if the window is fullscreen.
Motivation
It's a nightmare to figure out (with browser compatability).
Detailed Explanation
This is a translation of the top stack overflow answer: https://stackoverflow.com/questions/2863351/checking-if-browser-is-in-fullscreen
(web_sys needs Window, Screen)
Drawbacks, Rationale, and Alternatives
Does this design have drawbacks? Are there alternative approaches? Why is this
design the best of all designs available?
What prior art exists?
Unresolved Questions
What is not clear yet? What do we expect to clarify through implementation
and/or usage experience?
I'm not sure where this would fit, API wise. Perhaps in gloo-utils.
My proposal would be to add
gloo_utils::screen
which is short forgloo_utils::window().screen()
. This could provide a wrappedScreen
which mirrors the inner, while providing additional functions such asis_fullscreen()
.The text was updated successfully, but these errors were encountered: