Module smithay::wayland [−][src]
Expand description
Protocol-related utilities
This module contains several handlers to manage the Wayland protocol and the clients.
General structure
Most utilities provided in this module work in the same way:
- An
init
function or method will take the wayland display as argument and insert one or more globals into it. - If you want to remove a previously inserted global, just call the
destroy()
method on the associatedGlobal
. If you don’t plan to destroy the global at all, you don’t need to bother keeping theGlobal
around.
Some of these modules require you to provide a callback that is invoked for some
client requests that your logic needs to handle. In most cases these callback
are given as input an enum specifying the event that occurred, as well as the
DispatchData
from wayland_server
.
Provided helpers
Core functionality
The most fundamental module is the compositor
module, which provides the necessary
logic to handle the fundamental component by which clients build their windows: surfaces.
Following this, the shell
module contains the logic allowing clients to use their
surface to build concrete windows with the usual interactions. Different kind of shells
exist, but in general you will want to support at least the xdg
variant,
which is the standard used by most applications.
Then, the seat
module contains logic related to input handling. These helpers are used
to forward input (such as pointer action or keystrokes) to clients, and manage the input
focus of clients. Tightly coupled with it is the data_device
module, which handles
cross-client interactions such as accessing the clipboard, or drag’n’drop actions.
The shm
module provides the necessary logic for client to provide buffers defining the
contents of their windows using shared memory. This is the main mechanism used by clients
that are not hardware accelerated. As a complement, the dmabuf
module provides support
hardware-accelerated clients; it is tightly linked to the
backend::allocator
module.
The output
module helps forwarding to clients information about the display monitors that
are available. This notably plays a key role in HiDPI handling, and more generally notifying
clients about whether they are currently visible or not (allowing them to stop drawing if they
are not, for example).
Experimental helpers
The explicit_synchronization
module provides helpers to give clients fine-grained control
over the synchronization for accessing graphics buffer with the compositor, for low-latency
rendering. It is however still experimental, and largely untested.
Modules
Utilities for handling surfaces, subsurfaces and regions
Utilities for manipulating the data devices
Linux DMABUF protocol
Explicit buffer synchronization per wayland surface
Output advertising capabilities
Seat global utilities
Handler utilities for the various shell protocols
SHM handling helpers
Utilities for graphics tablet support
Structs
A serial type, whose comparison takes into account the wrapping-around behavior of the underlying counter.
A counter for generating serials, for use in the client protocol
Statics
A global SerialCounter
for use in your compositor.