desktop
only.Expand description
Desktop management helpers
This module contains helpers to organize and interact with desktop-style shells.
It is therefore a lot more opinionated than for example the xdg-shell handler and tightly integrates with some protocols (e.g. xdg-shell).
The usage of this module is therefor entirely optional and depending on your use-case you might also only want to use a limited set of the helpers provided.
§Helpers
§Window
A window represents what is typically understood by the end-user as a single application window.
Currently it abstracts over xdg-shell toplevels and Xwayland surfaces. It provides a bunch of methods to calculate and retrieve its size, manage itself, attach additional user_data as well as a drawing function to ease rendering it’s related surfaces.
Note that a Window
on it’s own has no position. For that it needs to be placed inside a Space
.
§Space
A space represents a two-dimensional plane of undefined dimensions.
Window
s (and other types implementing SpaceElement
) and Output
s can be mapped onto it.
Elements get a position and stacking order through mapping. Outputs become views of a part of the Space
and can be rendered via render_output
.
§Layer Shell
A LayerSurface
represents a surface as provided by e.g. the layer-shell protocol.
It provides similar helper methods as a Window
does to toplevel surfaces.
Each Output
can be associated a LayerMap
by calling layer_map_for_output
,
which LayerSurface
s can be mapped upon. Associated layer maps are automatically rendered by render_output
,
but a draw function is also provided for manual layer-surface management.
§Popups
Provides a PopupManager
, which can be used to automatically keep track of popups and their
relations to one-another. Popups are then automatically rendered with their matching toplevel surfaces,
when either crate::backend::renderer::element::AsRenderElements::render_elements
or render_output
is called.
§Remarks
Note that the desktop abstractions are concerned with easing rendering different clients and therefore need to be able
to manage client buffers to do so. If you plan to use the provided drawing functions, you need to use
on_commit_buffer_handler
.
Re-exports§
pub use self::space::Space;
Modules§
- space
- This module contains the
Space
helper class as well has related rendering helpers to add custom elements or different clients to a space. - utils
wayland_frontend
- Helper functions to ease dealing with surface trees
Structs§
- Layer
Map wayland_frontend
- Map of
LayerSurface
s on anOutput
- Layer
Surface wayland_frontend
- A
LayerSurface
represents a single layer surface as given by the wlr-layer-shell protocol. - Popup
Grab wayland_frontend
- Represents the explicit grab a client requested for a popup
- Popup
Keyboard Grab wayland_frontend
- Default implementation of a
KeyboardGrab
forPopupGrab
- Popup
Manager wayland_frontend
- Helper to track popups.
- Popup
Pointer Grab wayland_frontend
- Default implementation of a
PointerGrab
forPopupGrab
- Window
wayland_frontend
- Represents a single application window
- Window
Surface Type wayland_frontend
- Defines the surface types that can be
queried with
Window::surface_under
Enums§
- Popup
Grab Error wayland_frontend
- Defines the possible errors that
can be returned from
PopupManager::grab_popup
- Popup
Kind wayland_frontend
- Represents a popup surface
- Popup
Ungrab Strategy wayland_frontend
- Defines the possibly strategies
for the
PopupGrab::ungrab
operation - Window
Surface wayland_frontend
- Represents the surface of a
Window
Functions§
- find_
popup_ root_ surface wayland_frontend
- Finds the toplevel wl_surface this popup belongs to.
- get_
popup_ toplevel_ coords wayland_frontend
- Computes this popup’s location relative to its toplevel wl_surface’s geometry.
- layer_
map_ for_ output wayland_frontend
- Retrieve a
LayerMap
for a givenOutput
.