Expand description
The image’s own surface (feature wayland): on a Wayland compositor
with colour management, the viewport draws its image into a surface
of its own, below the window, that the compositor is told the
encoding of; egui’s interface stays sRGB on the window’s surface
(docs/wayland-colour.md).
Experimental: may change in any release
(docs/stability.md).
install(once, with eframe’s creation context) joins the compositor through the main window’s handles and records what it offers (Offer): its colour manager’s announcements, the formats and colour spaces a subsurface can be presented in.- Every other window gets an image surface of its own, under its own
surface and negotiated for what that window wants: set up with its
handles (
install_window), or the first frame it draws the image onceset_window_sourcesays where windows’ handles are read; freed when the window closes (close_window, or at the next frame once egui no longer knows the window). egui’s interface keeps egui-wgpu’s one surface format in every window. - Each frame, a window’s viewports
negotiatewhat the application wants for that window (display::want) against its offer (negotiate_window):Route::Tagged: a subsurface egui-pop tags itself throughwp_color_management_v1(BT.2020 with a 2.2 power, for one; KWin, sway, Weston);Route::Wsi: a subsurface presented in a colour space the driver’s window system integration declares (Display P3 where the compositor announces the sRGB transfer: GNOME, Hyprland);Route::Window: the window’s surface, sRGB, and why (display::Resolution::reason).
- With an image surface, the viewport renders its tiles there,
presents it just before egui presents the window (both apply in the
same compositor frame), and punches a transparent hole in the
interface where the image is: overlays, menus and tooltips drawn
after stay above it. The window must be transparent
(
ViewportBuilder::with_transparent(true)), or the hole would show black.
The EGUI_POP_IMAGE_SURFACE variable turns it off, or keeps the
driver’s colour spaces only (no-tag). The debug bridge’s viewport
collector reports it (report), with the compositor’s preferred
image description for each window; the window registry
(windows.list) shows each window’s (egui_pop_core::window_surface).
Re-exports§
pub use egui_pop_wayland::raw_window_handle;
Structs§
- Layout
- Where an image surface sits for an image rectangle.
- Negotiation
- Where the image goes for a wanted target, and why not better.
- Offer
- What the platform offers an image surface.
- Options
- How
installsets up image surfaces.
Enums§
- Route
- Where the image is drawn.
Constants§
- VARIABLE
- The environment variable:
off(no image surface),no-tag(the driver’s colour spaces only), anything else or unset (both).
Traits§
- Window
Handles - A window’s raw handles, as
set_window_sourcegives them.
Functions§
- clear_
colour - An sRGB colour encoded for a target (the image surface’s background).
- close_
window - Frees a window’s image surface (the window closed): its subsurfaces and connection go, its state is forgotten. Windows egui no longer knows are freed this way at the next frame.
- install
- Sets up image surfaces for the main window:
rsis the render state the GPU path was installed on (crate::gpu::install),windowthe main window’s handles (eframe’s creation context). Returns what the platform offers; viewports in the main window use it from the next frame. Other windows get theirs withinstall_window, or as they draw the image onceset_window_sourcesays where their handles are. - install_
offer - Records what a window’s platform offers without joining it: no surface is made, only the negotiation and its state (a test’s fake compositor, or a host presenting the image surface itself). The viewport’s widget then sends the image to that surface: use it where something presents it.
- install_
window - Sets up the image surface of another window (
viewport), with its own handles, afterinstall(whose render state it shares): its own parent surface, negotiated for what that window wants. Returns what the platform offers it; it is freed when the window closes (close_window). Withoutinstallfirst, none and why. - layout
- The image surface’s place for a rectangle
[x0, y0, x1, y1]in window pixels, atscalephysical pixels per logical one;Nonefor an empty one. - named_
primaries - The protocol’s name for primaries (custom ones have none).
- named_
transfer - The protocol’s name for a transfer (extended sRGB has none).
- negotiate
- Where the image goes for
wanted, given what the platform offers: the window’s surface for sRGB or without an image surface; else a surface tagged by egui-pop when it may and the compositor takes the encoding; else one in a colour space the driver declares; else the window’s, with why each step failed. - negotiate_
window - Where the image of
viewportgoes for what it wants (display::want): negotiates against that window’s offer when the wish changes, records the image surface’s target and why (display::set_image_surface, and the window’s entry inwindows.list). The viewport calls it each frame it draws the image on the GPU path; call it yourself only with an offer frominstall_offer(tests). - offer
- What
installfound for the main window, if it ran. - offer_
of - What the platform offers a window’s image surface, once set up.
- report
- What the image surfaces of
ctxare doing, for the debug bridge: the main window’s at the top level (as before), every window’s inwindows. - set_
window_ source - Says where the handles of a window opened after
installare read (egui_pop::api::runner::windowon egui-pop’s runner), and how such windows are built (options): a window drawing the image gets its own image surface the first frame its handles are known, freed when it closes. A window whose builder said how it was built (egui_pop_core::window_surface::set_transparency) is taken as said: transparent, it gets a surface whateveroptionssay; opaque, none, with the builder’s reason. - windows
- The windows with an image surface set up, the main window first.