Skip to main content

Module window

Module window 

Source
Expand description

The window’s place, as a plugin (WindowPlugin, in DefaultPlugins): its size, position, maximized and full-screen states are kept in the store (settings/window.*, saved with the settings, no undo step) and given back at the next start by AppBuilder::run_native, after a repair: a window whose title bar would be on no screen comes back onto the first one, one larger than its screen (or than what the GPU can draw) is shrunk.

Full screen (F11, View > Full screen) keeps the way out reachable: the application’s title bar keeps a button leaving it (frame::FramePlugin); without that bar (the system draws the frame, or window.bar_in_fullscreen is off), moving the pointer to the top edge shows a strip with the title and an “Exit full screen” button.

Where the window manager does not tell the window’s position (Wayland), only the size and the states are kept: the position an earlier run kept (X11, Windows) stays for the next run where it is told, never replaced by a made-up one, and the View menu says under Full screen that the system places the windows (POSITIONS_HIDDEN).

Structs§

Screen
A screen (a monitor), as the system tells it: its name, its rectangle in points and its scale factor. Given by whatever runs the event loop (set_screens): egui-pop’s native runner, or a host application running eframe on its own loop.
WindowPlugin
The plugin.
WindowState
The window’s place.

Enums§

Windowing
The windowing system the application’s windows are on, as the event loop’s display says it (runner::windowing): egui-pop’s runner reads it when the loop resumes, a host running its own loop tells it (runner::host::resumed).

Constants§

CMD_FULLSCREEN
Toggles full screen.
FULLSCREEN
LIST_PLACEMENT
The View menu’s note, under Full screen, where the system places the windows (POSITIONS_HIDDEN).
MAXIMIZED
MAX_SIDE
The largest side kept (a window past the GPU’s texture limit cannot be drawn).
MIN_SIDE
The smallest side kept.
PLACED
Whether the kept position is known (the window manager told it).
POSITIONS_HIDDEN
The context key saying the system tells no window’s position and places windows itself (Wayland): "true" there.
RECT
Where the window’s place is kept.
UNNAMED_SCREEN
The name a layout gives a screen it cannot name: a window detached where no screen is told by name (Wayland tells no positions, a system names no monitor). A window kept on it is never docked back for its screen being gone; its position is still repaired.

Functions§

apply
Puts a kept window place into a native window’s options.
from_settings
Reads the window’s place from a saved settings document.
repair_builder
A native window’s builder, its kept place repaired against the screens told (set_screens): a position off every screen is pulled back onto the first, a size larger than its screen shrunk; the maximized and full-screen flags stay. Unchanged while no screen is known. Called from eframe’s NativeOptions::window_builder hook, which runs as the main window is created (egui-pop’s native runner does it).
restore
Gives a native window the place kept in a settings directory (the one given to AppBuilder::persist), repaired: the screens are not known before the window exists, so only its size is bounded and a position far away dropped. Returns the place given, if one was kept. AppBuilder::run_native does it; an application running eframe itself calls it.
screen_list
The screens as told (set_screens), with their names and scale factors.
screen_name_at
The name of the screen rect is on (the one holding its centre, else the one it overlaps most), as told; none when no screen is told by name there.
screens
The screens, in points, as far as egui-pop knows them: those told by what runs the event loop (set_screens; egui-pop’s native runner tells them before the main window is created); none until told. A window’s kept place is repaired against them (WindowState::repair) before it opens.
set_screens
Tells egui-pop the screens, for the windows of this thread (the one running the event loop and the application’s frames). A host that runs the event loop itself (eframe on its own winit loop, without the create-native feature) reads the monitors and calls it: before the main window is created (so its kept place is repaired against them, repair_builder), and again when they change (a scale factor changed, a window moved to another monitor). egui-pop’s native runner calls it the same way. Windows opened after the call (detached panels, application windows) are repaired against the screens given; an empty list says none are known (only sizes are bounded).
surface_below_transparency
How a window that may show a surface below egui (the image viewport’s image surface, a Wayland subsurface) is built on windowing: transparent on Wayland, so that surface shows through; opaque elsewhere, where there is no such surface to show and a transparent window only costs the compositor, with the reason.
windowing
The windowing system of this run (Windowing): the runner’s, or Windowing::Unknown without one (the web, headless, tests).