pub fn toggle(window: &Window)Expand description
Put window into or out of fullscreen, whichever it is not.
A browser grants this only to a page with a transient activation, and the click on the button is what provides one. The request leaves that click’s own DOM handler — the panel records it and the frame loop reads it a frame or two later — but an activation outlives that by seconds, so the call is still made from inside the window the gesture opened.
A refusal is silent: winit neither reports nor logs one, so a browser that turns the request down simply leaves the app windowed. Nothing is asked for while already fullscreen except to leave it, so the button cannot trap a user in a display they did not choose.
Android’s winit backend logs and ignores the call, which is what leaves the button there a press that changes nothing.