Skip to main content

Module fullscreen

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§

AudiencePresentationRequest
A second, audience-only surface requested by a root widget.
FullscreenRequest
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.
MonitorInfo
A monitor as the App enumerated it from winit, reduced to the fields the output-selection needs. Pure data so select_output is unit-testable.

Enums§

FullscreenTarget
Which output an app wants its fullscreen surface promoted onto.
FullscreenView
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-1 is judged by its connector part.
select_audience_output
Pick the audience display for a two-screen presentation. None means 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 None to defer output choice to the compositor (Auto, an empty monitor list, or an out-of-range Output).
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. None when no other output exists — one screen keeps its ordinary layout.