Module fullscreen
Expand description
Shared fullscreen / presentation mechanism.
A root widget expresses a FullscreenRequest via
crate::widget::Widget::fullscreen_request. The App
(crate::app::App) polls it each frame, runs select_output over
the live monitors, and drives winit::window::Window::set_fullscreen —
a genuine borderless full-output surface, not a maximized window.
select_output is pure over MonitorInfo so it’s unit-tested
without a live window.
A headless session or a compositor which cannot expose its output globals
yields an empty monitor list; that degrades to Borderless(None), placed by
the compositor. Multi-output presentation is activated only after a distinct
monitor is enumerated.
The ranking behind FullscreenTarget::Largest is what a presenter
expects from a laptop plugged into a television: the slides go to the
external screen, the physically biggest one if there are several, and
the presenter view stays on the built-in panel (select_presenter_output).
The compositor runs the same functions, so a client that could not name
an output still lands where the app would have put it.
Structs§
- Audience
Presentation Request - A second, audience-only surface requested by a root widget.
- Fullscreen
Request - A fullscreen request a root widget expresses. Level-triggered: the App compares it against the live state each frame, so returning a steady request for the whole duration of a slideshow / immersive playback is correct.
- Monitor
Info - A monitor as the App enumerated it from winit, reduced to the fields the
output-selection needs. Pure data so
select_outputis unit-testable.
Enums§
- Fullscreen
Target - Which output an app wants its fullscreen surface promoted onto.
- Fullscreen
View - What the fullscreen surface should show.
Functions§
- connector_
is_ builtin - Whether a KMS connector name names a built-in panel: embedded
DisplayPort, LVDS and MIPI-DSI are how laptops, tablets and phones wire
their own screen. Anything else (HDMI, DP, USB-C alt-mode, virtual) is a
display someone plugged in. A collision-qualified name such as
card1/eDP-1is judged by its connector part. - select_
audience_ output - Pick the audience display for a two-screen presentation.
Nonemeans there is no second output, so the caller keeps its single-window fallback. - select_
output - Pure output selection: given the enumerated monitors and a target, return the
index of the chosen monitor, or
Noneto defer output choice to the compositor (Auto, an empty monitor list, or an out-of-rangeOutput). - select_
presenter_ output - Where the presenter view goes once the audience owns
audience: the built-in panel if there is one, else the smallest remaining display (the laptop-sized screen beside a projector), else the earliest index.Nonewhen no other output exists — one screen keeps its ordinary layout.