Skip to main content

AppState

Struct AppState 

Source
pub struct AppState {
Show 79 fields pub compositor_state: CompositorState, pub fractional_scale_state: FractionalScaleManagerState, pub viewporter_state: ViewporterState, pub presentation_state: PresentationState, pub shm_state: ShmState, pub single_pixel_buffer: SinglePixelBufferState, pub dmabuf_state: DmabufState, pub dmabuf_global: Option<DmabufGlobal>, pub ext_data_control_state: DataControlState, pub cursor_shape_state: CursorShapeManagerState, pub image_capture_source_state: ImageCaptureSourceState, pub output_capture_source_state: OutputCaptureSourceState, pub image_copy_capture_state: ImageCopyCaptureState, pub copy_sessions: Vec<OutputCopySession>, pub output_state: OutputManagerState, pub seat_state: SeatState<AppState>, pub shell_state: XdgShellState, pub layer_shell_state: WlrLayerShellState, pub space: Space<Window>, pub data_device_state: DataDeviceState, pub data_control_state: DataControlState, pub dh: DisplayHandle, pub seat: Seat<AppState>, pub output_nodes: Vec<OutputNode>, pub pending_windows: Vec<Window>, pub foreign_toplevel_list: ForeignToplevelListState, pub keyboard_shortcuts_inhibit_state: KeyboardShortcutsInhibitState, pub xdg_decoration_state: XdgDecorationState, pub xdg_activation_state: XdgActivationState, pub primary_selection_state: PrimarySelectionState, pub popups: PopupManager, pub(crate) screenshot_readbacks: ScreenshotReadbacks, pub gles_renderer: Option<GlesRenderer>, pub pixman_renderer: Option<PixmanRenderer>, pub gbm_device: Option<Device<File>>, pub settings: CaptureSettings, pub cursor_callback_set: bool, pub cursor_tx: Sender<CursorJob>, pub clipboard_callback: Option<Arc<dyn ClipboardSink>>, pub pending_clipboard_read: Option<Vec<String>>, pub clipboard_generation: Arc<AtomicU64>, pub current_selection_mimes: Vec<String>, pub last_log_time: Instant, pub start_time: Instant, pub clock: Clock<Monotonic>, pub use_gpu: bool, pub cursor_helper: Cursor, pub keymap_policy: KeymapPolicy, pub host: Option<HostSession>, pub host_layout_pending: HashMap<u32, PendingHostLayout>, pub host_frame_tx: Sender<usize>, pub host_mode_refusals: HashMap<u32, u32>, pub current_cursor_icon: Option<CursorImageStatus>, pub cursor_surface_pending: bool, pub cursor_buffer: Option<WlBuffer>, pub dnd_icon: Option<(WlSurface, Point<i32, Logical>)>, pub render_cursor_on_framebuffer: bool, pub pointer_warp_state: PointerWarpManager, pub relative_pointer_state: RelativePointerManagerState, pub pointer_constraints_state: PointerConstraintsState, pub render_node_path: String, pub auto_gpu_selected: bool, pub(crate) pending_screenshots: ScreenshotQueue, pub command_rx: Option<Channel<ThreadCommand>>, pub last_input_at: Option<Instant>, pub pointer_motion_at: Option<Instant>, pub input_interval: Option<Duration>, pub pointer_share: Arc<PointerShare>, pub motion_applied: u64, pub frame_idle_long: bool, pub last_idle_service_at: Option<Instant>, pub deliver_reaper: Vec<JoinHandle<()>>, pub encode_reaper: Vec<JoinHandle<Option<FrameEncoder>>>, pub wm: Option<WmState>, pub foreign_toplevel: ForeignToplevelState, pub workspace: WorkspaceState, pub xwm: XwmState, pub loop_handle: LoopHandle<'static, AppState>, pub keyboard_focus: Option<u32>,
}
Expand description

Central context threaded through every Smithay handler; owns the Wayland globals, the GBM/EGL (or pixman) renderer state, and the capture/encode pipeline state.

A single AppState lives for the whole compositor thread and is mutated in place by the calloop event sources (client dispatch, input injection, the capture timer). The frame pipeline is instantiated PER DISPLAY: each OutputNode in output_nodes owns its output, damage tracker, and render targets, and its optional WlCapture owns that display’s encoder set and delivery. The non-obvious WlCapture/OutputNode fields encode the pipeline’s threading and buffer strategy:

  1. Render / encode targets (per display):

    • video_encoder: the zero-copy GPU session only (GLES render + same-GPU dmabuf encode). Its EGL/dmabuf handles are calloop-affine, so this encoder runs inline on the calloop thread; it is None whenever a readback path is active.
    • encode_pool / encode_join: the readback capture||encode split. The calloop renders and reads back into a pooled host buffer and publishes it, while a separate encode thread owns the CPU / cross-GPU / pixman-HW encoders. encode_join returns that thread’s hardware session on shutdown so a restart can reconfigure it in place rather than rebuild it. Both are None while a zero-copy GPU session runs.
    • frame_buffer: scratch render target used only by the pixman memory-throttle path; the normal readback path renders and reads back into the pooled buffers instead.
    • pool_last_render / render_seq: buffer-age bookkeeping for the pixman path, which renders directly into the pooled buffers (an age is “renders since this slot was last the target”). The GLES path renders into one fixed offscreen buffer and never consults these.
    • pool_content_gen / content_gen: staleness bookkeeping for the GLES readback path, which skips the GPU readback on no-damage ticks. content_gen advances whenever a render reports damage; a pooled buffer whose stamp lags it holds pre-damage pixels and must be read back once before publishing, so the encoder’s paint-over / burst / recovery sends never ship stale content.
  2. Delivery (deliver_tx / deliver_join): encoded frames go to a dedicated delivery thread over a capacity-1 rendezvous channel, mirroring the X11 single-slot FramePool (non-dropping, ordered, at most one frame of blocking backpressure), so a slow GIL-holding Python callback can never stall input/control dispatch on the calloop thread.

  3. Keyframes (pending_force_idr): set by an IDR request (client reconnect / decoder reset) and consumed once on the next captured frame to force an immediate keyframe.

  4. Clipboard (pending_clipboard_read): stages the mimes chosen in new_selection, or a cleared selection; the loop drains them only after the dispatch that stores the new client source, so the read targets the new selection rather than the previous one.

  5. GPU selection (auto_gpu_selected): records that automatic (not explicit) selection picked render_node_path, so StartCapture aims the encoder at that same node unless a device was chosen explicitly.

Fields§

§compositor_state: CompositorState§fractional_scale_state: FractionalScaleManagerState§viewporter_state: ViewporterState§presentation_state: PresentationState§shm_state: ShmState§single_pixel_buffer: SinglePixelBufferState§dmabuf_state: DmabufState§dmabuf_global: Option<DmabufGlobal>§ext_data_control_state: DataControlState§cursor_shape_state: CursorShapeManagerState§image_capture_source_state: ImageCaptureSourceState§output_capture_source_state: OutputCaptureSourceState§image_copy_capture_state: ImageCopyCaptureState§copy_sessions: Vec<OutputCopySession>§output_state: OutputManagerState§seat_state: SeatState<AppState>§shell_state: XdgShellState§layer_shell_state: WlrLayerShellState§space: Space<Window>§data_device_state: DataDeviceState§data_control_state: DataControlState§dh: DisplayHandle§seat: Seat<AppState>§output_nodes: Vec<OutputNode>

Every live output with its per-display render/capture state; index 0 is the primary (display id 0), which is never destroyed.

§pending_windows: Vec<Window>§foreign_toplevel_list: ForeignToplevelListState§keyboard_shortcuts_inhibit_state: KeyboardShortcutsInhibitState

The shortcuts-inhibit protocol: a client whose window has the keyboard may ask that the window policy’s binds stand aside while it reads a chord (the desktop shell’s shortcut editor); the policy’s key filter honors an active inhibitor on the focused window.

§xdg_decoration_state: XdgDecorationState§xdg_activation_state: XdgActivationState§primary_selection_state: PrimarySelectionState§popups: PopupManager§screenshot_readbacks: ScreenshotReadbacks

Screenshot readback buffers, ahead of the renderer: dropped first, they forget their mappings while its GL context still holds them.

§gles_renderer: Option<GlesRenderer>§pixman_renderer: Option<PixmanRenderer>§gbm_device: Option<Device<File>>§settings: CaptureSettings

Mirror of the PRIMARY display’s capture settings (geometry fallbacks, computer-use info); per-display settings live on each capture.

§cursor_callback_set: bool

A cursor sink is registered on the wl-cursor worker (which owns it); tracked here so sprite resolution is skipped while nobody listens.

§cursor_tx: Sender<CursorJob>

Cursor delivery jobs to the wl-cursor worker (PNG encode + sink call off-thread).

§clipboard_callback: Option<Arc<dyn ClipboardSink>>§pending_clipboard_read: Option<Vec<String>>

The mimes of the current client selection staged for one read, delivered together; an empty list stages the report of a selection a client cleared.

§clipboard_generation: Arc<AtomicU64>

Bumped by every staged delivery. A reader thread hands its entries over only while its delivery is still the newest, so a slow source cannot land after a later copy or clear.

§current_selection_mimes: Vec<String>

The mimes chosen from the current CLIENT-owned clipboard selection, recorded even while no callback is registered so SetClipboardCallback can re-stage a read of a copy made in the gap; empty when the selection is cleared or compositor-owned.

§last_log_time: Instant§start_time: Instant§clock: Clock<Monotonic>§use_gpu: bool§cursor_helper: Cursor§keymap_policy: KeymapPolicy

Seat keymap owner: base layout plus batched overlay binds. Every seat keymap swap flows through this policy, so keymap identity has exactly one writer.

§host: Option<HostSession>

Host-capture session when pixelflux captures an EXTERNAL compositor: frames arrive by screencopy and input routes to its virtual devices.

§host_layout_pending: HashMap<u32, PendingHostLayout>

Per display, the layout request the host has not answered yet. A capture start submits its mode and carries on at that size; the render tick waits for the host to answer, then re-sizes the capture to the mode the host announces. Emptied with the host session.

§host_frame_tx: Sender<usize>

Wakes the calloop when a host capture thread has queued a frame, so its display renders that frame at once (at frame pace, see FramePace) rather than on the next timer tick.

§host_mode_refusals: HashMap<u32, u32>

Per display, how many mode requests in a row the host has answered with a different mode; cleared when it applies one. Past a few, the log names the remedy.

§current_cursor_icon: Option<CursorImageStatus>§cursor_surface_pending: bool

A surface-backed cursor set during the dispatch in progress and not delivered yet: clients commit the sprite’s buffer after set_cursor in the same batch, so delivery waits for that commit, or for the end of the dispatch when none comes, rather than shipping the surface’s previous sprite under the new hotspot.

§cursor_buffer: Option<WlBuffer>§dnd_icon: Option<(WlSurface, Point<i32, Logical>)>

The icon a client’s drag carries, drawn at the pointer into every frame while the drag lasts (the cursor itself is the browser’s to draw, a drag’s icon is not), with the offset from the pointer its commits moved it to.

§render_cursor_on_framebuffer: bool§pointer_warp_state: PointerWarpManager§relative_pointer_state: RelativePointerManagerState§pointer_constraints_state: PointerConstraintsState§render_node_path: String§auto_gpu_selected: bool§pending_screenshots: ScreenshotQueue

Screenshot readbacks waiting for their output’s next render.

§command_rx: Option<Channel<ThreadCommand>>

The command channel, drained in place (wakeups arrive on a separate ping channel) so the render tick can apply every queued command BEFORE starting a long render/encode — queued input is never starved behind the tick it arrived during.

§last_input_at: Option<Instant>

When the last input command landed: the no-capture tick speeds up right after input so apps pacing on frame callbacks respond promptly (they are the ones noticing the idle rate while nobody encodes).

§pointer_motion_at: Option<Instant>

When the last pointer move landed, and the smoothed spacing between moves: what tells a client pacing its moves at the frame cadence from a faster or slower one (FramePace::input_paced). A gap longer than a few periods is a pause rather than a spacing and is clamped before it enters the average.

§input_interval: Option<Duration>§pointer_share: Arc<PointerShare>

Where the pointer is, published each event-loop pass for the backend’s pointer_location.

§motion_applied: u64

The highest motion number among the motion commands applied (PointerAt::motion).

§frame_idle_long: bool

Whether the frame timer is armed at the long idle interval: input arriving then must not wait that deadline out, so the wake handler sends the idle frame callbacks itself (frame-paced via last_idle_service_at) instead of waiting for the timer.

§last_idle_service_at: Option<Instant>

When idle frame callbacks were last serviced, bounding the wake handler’s servicing to frame pace under an input storm.

§deliver_reaper: Vec<JoinHandle<()>>

Deliver threads of stopped captures, joined without blocking the event loop: the timer tick reaps the finished ones, and the shutdown Barrier drains the rest so nothing that can attach to Python outlives it.

§encode_reaper: Vec<JoinHandle<Option<FrameEncoder>>>

Encode threads whose teardown-time harvest expired (wedged behind a consumer inside Python); reaped like the deliver threads, with the unclaimed encoder dropped here on the event loop — its usual home.

§wm: Option<WmState>

The installed window policy and what the compositor keeps for it; None leaves every window fullscreen on its output (crate::wayland::wm).

§foreign_toplevel: ForeignToplevelState

The window list taskbars read (zwlr_foreign_toplevel_manager_v1).

§workspace: WorkspaceState

The virtual desktops pagers read and switch (ext_workspace_manager_v1).

§xwm: XwmState

Xwayland and its window manager, started under a window policy.

§loop_handle: LoopHandle<'static, AppState>

The compositor’s event loop, for sources started after it is up (Xwayland).

§keyboard_focus: Option<u32>

The window holding the keyboard, as the seat last reported it: read where the seat’s own lock is held (focus_changed runs under it), where asking the keyboard would wait on itself.

Implementations§

Source§

impl AppState

Source

pub(crate) fn window_of_toplevel( &self, toplevel: &ToplevelSurface, ) -> Option<Window>

The window (shown, pending, or hidden by the policy) a toplevel belongs to.

Source

pub(crate) fn id_of_toplevel(&self, toplevel: &ToplevelSurface) -> Option<u32>

The policy’s id of a toplevel’s window.

Source

pub(crate) fn primary_output(&self) -> Option<&Output>

The primary (display id 0) output.

Source

pub(crate) fn node_idx_for_id(&self, id: u32) -> Option<usize>

Source

pub(crate) fn view_ids_of(&self, id: u32) -> Vec<u32>

The ids of the views onto id’s output.

Source

pub(crate) fn screen_id_of(&self, id: u32) -> u32

The node whose output id draws from: itself, or the node it views.

Source

pub(crate) fn node_idx_under(&self, p: Point<f64, Logical>) -> Option<usize>

Index of the node whose LOGICAL rect contains p.

Source

pub(crate) fn layout_physical_to_logical( &self, x: f64, y: f64, ) -> Point<f64, Logical>

Map absolute PHYSICAL union-layout coordinates to a logical layout point: each output occupies the physical rectangle at its layout offset sized by its mode; the point is clamped into the nearest output when it falls outside all of them, so the pointer can never leave the layout.

Source

pub(crate) fn pointer_locked( &self, pointer: &PointerHandle<Self>, under: &Option<(FocusTarget, Point<f64, Logical>)>, location: Point<f64, Logical>, ) -> bool

Whether an active lock holds the pointer where it is, so a motion must carry the delta alone. Only the surface the pointer has entered can hold it, and only inside the region the lock names.

Source

pub(crate) fn pointer_target_under( &self, p: Point<f64, Logical>, ) -> Option<(FocusTarget, Point<f64, Logical>)>

What the pointer targets at a logical layout point: an overlay layer surface, an X11 override-redirect window on top under the point, a top layer surface, then a window, then a bottom or background layer surface, each through its popup where one lies under the point, since a popup takes pointer events on its own surface. That is the order they are drawn in. Layer geometry is output-local, so layers are hit-tested with the point local to the output under it. Whatever is found is then resolved to the subsurface of its tree that takes input at the point (FocusTarget::under_point): a subsurface takes pointer events on its own surface too, and handed to the surface below it, a click on a browser’s bubble lands on the page under the bubble.

While an X11 popup menu is open, the pointer is that menu’s wherever it is, outside the menu too: an X11 client grabs the pointer for its menu and closes the menu on a click elsewhere, but rootless Xwayland hears of the pointer only over its own windows, so a click on a Wayland surface would leave the menu open and holding the pointer. [x11_menu_open]’s window gets the events, at points Xwayland turns into the root coordinates the grab is delivered with.

Source

fn x11_menu_open(&self) -> Option<(FocusTarget, Point<f64, Logical>)>

The topmost X11 popup menu that is open, with where it lies.

Source

pub(crate) fn refocus_pointer(&mut self)

Hands pointer focus to what now lies under a still pointer once a window maps, unmaps, or moves, and ahead of a button or scroll that comes with no motion (a pointer-locked one), so input reaches what is shown there. A held grab keeps its focus until it ends. An enter reaches only the wl_pointers a client already holds and is not repeated to one bound later, so a client yet to bind one is not entered here: the window no longer shown is left, and the client’s first input after it binds enters it.

Source

pub(crate) fn activate_constraint_under( &self, pointer: &PointerHandle<Self>, under: &Option<(FocusTarget, Point<f64, Logical>)>, location: Point<f64, Logical>, )

Activates a constraint waiting on the surface the pointer has arrived over.

Source

pub(crate) fn clamp_logical( &self, p: Point<f64, Logical>, ) -> Point<f64, Logical>

Clamp a logical layout point into the nearest output’s logical rectangle.

Source

pub(crate) fn layout_logical_to_physical( &self, p: Point<f64, Logical>, ) -> (f64, f64)

Logical layout point -> physical union-layout coordinates (inverse of layout_physical_to_logical for in-bounds points; primary-relative otherwise).

Source

pub(crate) fn layout_logical_to_physical_scaled( &self, p: Point<f64, Logical>, ) -> (f64, f64, f64)

layout_logical_to_physical, with the scale of the output it mapped through.

Source

pub(crate) fn logical_size_of(&self, id: u32) -> Option<(i32, i32)>

Logical size of the given display’s output.

Source

pub(crate) fn release_grab_across_screens( &mut self, pointer: &PointerHandle<Self>, under: &Option<(FocusTarget, Point<f64, Logical>)>, serial: Serial, time: InputTime, )

A nested session opens one host toplevel per screen, and a drag it carries from one screen to the next is its own to continue: the implicit grab that would keep handing the first window motion past its edge is released at the crossing, so the pointer enters the next screen’s window and the session places its cursor through that window, at that screen’s scale. Only a click grab still holding the window it started on is released, and only for another window of the same client.

Source

pub(crate) fn pointer_shown_at(&self) -> Option<Point<f64, Logical>>

Where the pointer is shown: where the window policy took it while it takes the pointer’s motion, else the seat’s pointer (crate::wayland::wm::judged_location). A frame drag whose press grabbed for the client moves the window and not the seat’s pointer, so the cursor drawn into the stream, the position the page is told, and the display the pointer is on would otherwise stay where the drag began until it ends.

Source

pub(crate) fn pointer_display(&self) -> u32

The display id under the pointer (primary when indeterminate).

Source

pub(crate) fn would_cover_screen(&self, window: &Window, id: u32) -> bool

Whether window would land on top of a screen another window from the same client already occupies. A nested session opens one host toplevel per screen, and a second one covering the first would replace what the display shows rather than add to it.

Source

pub(crate) fn park_window(&mut self, window: &Window, id: u32)

Map window clear of every output while keeping it tagged for id, so it holds its size and its place in the window list without being composited anywhere. A nested session’s spare screens wait here until create_output gives them one.

Source

pub(crate) fn place_window_on_output( &mut self, window: &Window, id: u32, ) -> bool

Place window on output id: retag its meta, remap it at the output’s layout origin, move output enter/leave, push the output’s fractional scale, and send the forced-fullscreen configure at that output’s logical size.

Source

pub(crate) fn process_pending_clipboard_read(&mut self)

Drain the clipboard delivery staged by new_selection and hand its (mime, bytes) entries, the flavors of one copy, to the clipboard sink off-thread; a cleared selection is handed over as no entries.

Runs from the loop after the dispatch that stored the new client source, so the requests target the current selection rather than the previous one. It clones the callback, opens a pipe per mime, and asks the owning client source to write each into its pipe’s writer. A spawned reader thread then reads the responses in turn. The overall bound is by SIZE (64 MiB per flavor, then delivered truncated) so a hostile client cannot balloon memory; time only bounds INACTIVITY — a producer that keeps bytes flowing may take as long as it needs (a large transfer from a slow source still delivers), while one that goes silent for 10 s without closing its fd is dropped so each clipboard change cannot leak a pinned thread + pipe. Deliveries leave in the order they were staged: one that a later copy or clear overtook is dropped (clipboard_generation). The SHUTDOWN checks keep this off a consumer that is gone.

Source

pub(crate) fn send_cursor_image(&mut self, image: &CursorImageStatus)

Resolve a CursorImageStatus into a job for the wl-cursor worker, which does the PNG encode, caching, and the GIL-bound Python call off the calloop thread. Also re-invoked from the calloop command handlers to replay the retained cursor when a callback (re)registers or a capture restarts.

Only the renderer/surface-affine work happens here:

  1. Named / Hidden: forwarded as-is (the worker owns its own theme handle).

  2. Surface (a client-supplied cursor sprite): ignore any surface without the cursor_image role, read the hotspot, then read the backing buffer by one of two paths:

    • SHM: hash only the sprite’s sub-region — width/height/stride/offset/format plus the pixel span — because many sprites share one pool and differ only by offset, so hashing the whole pool would collide; ship the raw pool bytes plus descriptor to the worker.
    • dmabuf (NotManaged): bind it to the GLES renderer, copy the framebuffer to Abgr8888, map it back (calloop-affine), and ship the raw RGBA readback.

    A sprite whose buffer could not be read is dropped by the worker, preserving the consumer’s last cursor instead of blanking it (only “hide” carries empty data).

Source

pub(crate) fn flush_pending_cursor(&mut self)

Deliver a surface-backed cursor whose dispatch ended without a commit of its surface (a client re-showing a sprite it attached earlier).

Source

pub(crate) fn apply_keymap_policy(&mut self)

Re-apply the policy’s keymap (base + overlays) to the seat keyboard, broadcasting to clients only when the content actually changed (smithay dedupes by content hash).

Source

pub(crate) fn apply_keymap_text(&mut self, text: String)

Deliver text as the seat keymap (and the host virtual keyboard’s, in host-capture mode). Empty text is ignored.

Source

pub(crate) fn bind_keysyms(&mut self, keysyms: &[u32]) -> Vec<(u32, u32)>

Resolve keysyms to (keycode, level) pairs, overlay-binding whatever the base cannot produce — at most ONE keymap swap for the whole batch, and never rebinding a keycode that is currently held down. Serves computer-use; the interactive input path resolves keysyms in selkies and injects plain keycodes.

Source

pub(crate) fn bind_keysyms_plain(&mut self, keysyms: &[u32]) -> Vec<u32>

bind_keysyms restricted to level-0 resolutions (see KeymapPolicy::bind_many_plain); used by the virtual-keyboard translation path, which cannot synthesize modifiers.

Source

pub(crate) fn send_forced_fullscreen_configure( &mut self, toplevel: &ToplevelSurface, )

Answer any client fullscreen/maximize (un)set request with the compositor’s forced policy: every toplevel is Fullscreen+Activated at the CURRENT logical size of the output the window is placed on. The configure is always sent, so an app toggling fullscreen gets an explicit, current-geometry answer instead of silence or stale pending state.

Source§

impl AppState

Source

pub fn copy_frame_pending_for(&self, output: &Output) -> bool

Trait Implementations§

Source§

impl BufferHandler for AppState

Buffer lifecycle hook: buffer destruction needs no bookkeeping here.

Source§

fn buffer_destroyed(&mut self, _buffer: &WlBuffer)

Called when the client has destroyed the buffer. Read more
Source§

impl CompositorHandler for AppState

Core wl_compositor protocol: per-surface commit handling plus the window map/configure/focus state machine.

Source§

fn commit(&mut self, surface: &WlSurface)

Fold a client’s wl_surface.commit into compositor state and — the reason the window logic lives in this handler — walk a brand-new toplevel through the xdg-shell handshake it must finish before it may be shown.

A window cannot just appear on its first commit: xdg-shell requires the compositor to send an initial configure (telling the client the size and state to draw at) and the client to ack it and commit a buffer matching that size before the surface counts as mapped. Mapping earlier would flash an unconfigured, wrongly-sized window into the captured frame. So a pending toplevel is carried across two commits instead of one, while everything else here is per-commit housekeeping that must run whether or not a map is in flight. On each commit, in order:

  1. Buffer intake: on_commit_buffer_handler ingests the newly attached buffer.
  2. Layer relayout: if the surface is a mapped layer surface, re-arrange the output’s layer map so geometry tracks the new content.
  3. Cursor refresh: if the surface backs the current cursor, re-send its image so a client animating its own cursor surface is reflected downstream.
  4. Foreign-toplevel metadata: push the current title / app-id to the foreign-toplevel handle for taskbar-style clients.
  5. Window on-commit: forward the commit to the matching mapped Window.
  6. Two-phase map of a pending toplevel:
    • First commit — no initial configure sent yet: this commit is the client announcing it wants to be shown, so compute the logical size from the output mode/scale (falling back to the settings resolution), send a fullscreen + activated configure, and re-queue the window to wait for the client’s acked commit — nothing is mapped yet.
    • Acked commit — the client has drawn to that configure: map the element at the origin, refresh its cached bounding box before reading geometry (so the drift check sees current geometry and doesn’t fire a redundant configure), enter the output, and, only if the client’s geometry still drifts more than a pixel from the expected fullscreen size, send one corrective configure. Finally give the new window keyboard focus so input lands on it at once.
Source§

fn compositor_state(&mut self) -> &mut CompositorState

[CompositorState] getter
Source§

fn client_compositor_state<'a>( &self, client: &'a Client, ) -> &'a CompositorClientState

[CompositorClientState] getter Read more
§

fn new_surface(&mut self, surface: &WlSurface)

New surface handler. Read more
§

fn new_subsurface(&mut self, surface: &WlSurface, parent: &WlSurface)

New subsurface handler. Read more
§

fn destroyed(&mut self, _surface: &WlSurface)

The surface was destroyed. Read more
Source§

impl DataControlHandler for AppState

wlr-data-control protocol: exposes the managed state so privileged clients can read and set selections.

Source§

fn data_control_state(&mut self) -> &mut DataControlState

[DataControlState] getter.
Source§

impl DataControlHandler for AppState

ext-data-control: the standardized successor of wlr-data-control. Both globals stay advertised, sharing the same selection state, so older clipboard managers keep working while current ones use the ext protocol.

Source§

fn data_control_state(&mut self) -> &mut ExtDataControlState

[DataControlState] getter.
Source§

impl DataDeviceHandler for AppState

wl_data_device protocol: exposes the managed state for drag-and-drop and clipboard data transfers.

Source§

fn data_device_state(&mut self) -> &mut DataDeviceState

[DataDeviceState] getter
§

fn action_choice( &mut self, available: DndAction, preferred: DndAction, ) -> DndAction

Action chooser for DnD negotiation
Source§

impl Dispatch<ExtWorkspaceGroupHandleV1, ()> for AppState

Source§

fn request( _state: &mut Self, _client: &Client, _group: &ExtWorkspaceGroupHandleV1, _request: Request, _data: &(), _dh: &DisplayHandle, _data_init: &mut DataInit<'_, Self>, )

Called when a request from a client is processed. Read more
§

fn destroyed( _state: &mut State, _client: ClientId, _resource: &I, _data: &UserData, )

Called when the object this user data is associated with has been destroyed. Read more
Source§

impl Dispatch<ExtWorkspaceHandleV1, HandleData> for AppState

Source§

fn request( state: &mut Self, _client: &Client, _handle: &ExtWorkspaceHandleV1, request: Request, data: &HandleData, _dh: &DisplayHandle, _data_init: &mut DataInit<'_, Self>, )

Called when a request from a client is processed. Read more
§

fn destroyed( _state: &mut State, _client: ClientId, _resource: &I, _data: &UserData, )

Called when the object this user data is associated with has been destroyed. Read more
Source§

impl Dispatch<ExtWorkspaceManagerV1, ()> for AppState

Source§

fn request( state: &mut Self, _client: &Client, manager: &ExtWorkspaceManagerV1, request: Request, _data: &(), _dh: &DisplayHandle, _data_init: &mut DataInit<'_, Self>, )

Called when a request from a client is processed. Read more
Source§

fn destroyed( state: &mut Self, _client: ClientId, manager: &ExtWorkspaceManagerV1, _data: &(), )

Called when the object this user data is associated with has been destroyed. Read more
Source§

impl<I, UserData> Dispatch<I, UserData> for AppState
where I: Resource, UserData: Dispatch2<I, AppState>,

Source§

fn request( state: &mut Self, client: &Client, resource: &I, request: <I as Resource>::Request, data: &UserData, dhandle: &DisplayHandle, data_init: &mut DataInit<'_, Self>, )

Called when a request from a client is processed. Read more
Source§

fn destroyed(state: &mut Self, client: ClientId, resource: &I, data: &UserData)

Called when the object this user data is associated with has been destroyed. Read more
Source§

impl Dispatch<ZwlrForeignToplevelHandleV1, HandleData> for AppState

Source§

fn request( state: &mut Self, _client: &Client, handle: &ZwlrForeignToplevelHandleV1, request: Request, data: &HandleData, _dh: &DisplayHandle, _data_init: &mut DataInit<'_, Self>, )

Called when a request from a client is processed. Read more
§

fn destroyed( _state: &mut State, _client: ClientId, _resource: &I, _data: &UserData, )

Called when the object this user data is associated with has been destroyed. Read more
Source§

impl Dispatch<ZwlrForeignToplevelManagerV1, ()> for AppState

Source§

fn request( state: &mut Self, _client: &Client, manager: &ZwlrForeignToplevelManagerV1, request: Request, _data: &(), _dh: &DisplayHandle, _data_init: &mut DataInit<'_, Self>, )

Called when a request from a client is processed. Read more
Source§

fn destroyed( state: &mut Self, _client: ClientId, manager: &ZwlrForeignToplevelManagerV1, _data: &(), )

Called when the object this user data is associated with has been destroyed. Read more
Source§

impl Dispatch<ZwpVirtualKeyboardManagerV1, ()> for AppState

Source§

fn request( _state: &mut Self, _client: &Client, _resource: &ZwpVirtualKeyboardManagerV1, request: Request, _data: &(), _dh: &DisplayHandle, data_init: &mut DataInit<'_, Self>, )

Called when a request from a client is processed. Read more
§

fn destroyed( _state: &mut State, _client: ClientId, _resource: &I, _data: &UserData, )

Called when the object this user data is associated with has been destroyed. Read more
Source§

impl Dispatch<ZwpVirtualKeyboardV1, PfVirtualKeyboard> for AppState

Source§

fn destroyed( state: &mut Self, _client: ClientId, _resource: &ZwpVirtualKeyboardV1, data: &PfVirtualKeyboard, )

Release every seat key this virtual keyboard still holds, so a VK client that disconnects mid-press cannot leave keys logically stuck.

Source§

fn request( state: &mut Self, _client: &Client, resource: &ZwpVirtualKeyboardV1, request: Request, data: &PfVirtualKeyboard, _dh: &DisplayHandle, _data_init: &mut DataInit<'_, Self>, )

Called when a request from a client is processed. Read more
Source§

impl DmabufHandler for AppState

Linux-dmabuf protocol: imports client dmabufs into the GLES renderer.

dmabuf_imported attempts the import into the GLES renderer and signals the client through the notifier — success only when a GLES renderer exists and the import succeeds, otherwise failure (the software / pixman path advertises no dmabuf global, so it always fails here).

Source§

fn dmabuf_state(&mut self) -> &mut DmabufState

Returns a mutable reference to the [DmabufState] delegate type.
Source§

fn dmabuf_imported( &mut self, _global: &DmabufGlobal, dmabuf: Dmabuf, notifier: ImportNotifier, )

This function is called when a client has imported a [Dmabuf]. Read more
§

fn new_surface_feedback( &mut self, _surface: &WlSurface, _global: &DmabufGlobal, ) -> Option<DmabufFeedback>

This function allows to override the default [DmabufFeedback] for a surface Read more
Source§

impl DndFocus<AppState> for FocusTarget

Forward drag-and-drop focus events (enter / motion / leave / drop) to the wrapped target’s underlying wl_surface, reusing the WlSurface offer-data type.

Source§

type OfferData<S: Source> = <WlSurface as DndFocus<AppState>>::OfferData<S>

OfferData implementation returned by this target
Source§

fn enter<S: Source>( &self, data: &mut AppState, dh: &DisplayHandle, source: Arc<S>, seat: &Seat<AppState>, location: Point<f64, Logical>, serial: &Serial, ) -> Option<Self::OfferData<S>>

An active Drag’n’Drop operation has entered the client
Source§

fn motion<S: Source>( &self, data: &mut AppState, offer: Option<&mut Self::OfferData<S>>, seat: &Seat<AppState>, location: Point<f64, Logical>, time: InputTime, )

An active Drag’n’Drop operation, which has previously entered the client, has been moved
Source§

fn leave<S: Source>( &self, data: &mut AppState, offer: Option<&mut Self::OfferData<S>>, seat: &Seat<AppState>, )

An active Drag’n’Drop operation, which has previously entered the client, left again.
Source§

fn drop<S: Source>( &self, data: &mut AppState, offer: Option<&mut Self::OfferData<S>>, seat: &Seat<AppState>, )

An active Drag’n’Drop operation, which has previously entered the client, has been dropped.
Source§

impl DndGrabHandler for AppState

The end of a drag-and-drop grab, an X11 client’s or a Wayland client’s: the drag’s icon is no longer drawn.

Source§

fn dropped( &mut self, _target: Option<DndTarget<'_, Self>>, _validated: bool, _seat: Seat<Self>, _location: Point<f64, Logical>, )

The drag’n’drop action was finished by the user releasing the pointer button / touch inputs. Read more
Source§

fn cancelled(&mut self, _seat: Seat<Self>, _location: Point<f64, Logical>)

The grab was cancelled by removing the grab by some means other than releasing the mouse button or touch up.
Source§

impl ForeignToplevelListHandler for AppState

Foreign-toplevel-list protocol: exposes the managed state so Smithay can advertise each toplevel (title / app-id) to listing clients such as taskbars.

Source§

fn foreign_toplevel_list_state(&mut self) -> &mut ForeignToplevelListState

[ForeignToplevelListState] getter
Source§

impl FractionalScaleHandler for AppState

Fractional-scale protocol: tells a newly-bound surface the output’s current fractional scale so it renders at the right pixel density.

Source§

fn new_fractional_scale(&mut self, surface: WlSurface)

A new fractional scale was instantiated
Source§

impl GlobalDispatch<ExtWorkspaceManagerV1, ()> for AppState

Source§

fn bind( state: &mut Self, _dh: &DisplayHandle, client: &Client, resource: New<ExtWorkspaceManagerV1>, _global_data: &(), data_init: &mut DataInit<'_, Self>, )

Called when a client has bound this global. Read more
§

fn can_view(_client: Client, _global_data: &GlobalData) -> bool

Checks if the global should be advertised to some client. Read more
Source§

impl<I, UserData> GlobalDispatch<I, UserData> for AppState
where I: Resource, UserData: GlobalDispatch2<I, AppState>,

Source§

fn bind( state: &mut Self, dhandle: &DisplayHandle, client: &Client, resource: New<I>, data: &UserData, data_init: &mut DataInit<'_, Self>, )

Called when a client has bound this global. Read more
Source§

fn can_view(client: Client, data: &UserData) -> bool

Checks if the global should be advertised to some client. Read more
Source§

impl GlobalDispatch<ZwlrForeignToplevelManagerV1, ()> for AppState

Source§

fn bind( state: &mut Self, _dh: &DisplayHandle, client: &Client, resource: New<ZwlrForeignToplevelManagerV1>, _global_data: &(), data_init: &mut DataInit<'_, Self>, )

Called when a client has bound this global. Read more
§

fn can_view(_client: Client, _global_data: &GlobalData) -> bool

Checks if the global should be advertised to some client. Read more
Source§

impl GlobalDispatch<ZwpVirtualKeyboardManagerV1, ()> for AppState

Source§

fn bind( _state: &mut Self, _dh: &DisplayHandle, _client: &Client, resource: New<ZwpVirtualKeyboardManagerV1>, _global_data: &(), data_init: &mut DataInit<'_, Self>, )

Called when a client has bound this global. Read more
§

fn can_view(_client: Client, _global_data: &GlobalData) -> bool

Checks if the global should be advertised to some client. Read more
Source§

impl ImageCaptureSourceHandler for AppState

Source§

fn source_destroyed(&mut self, _source: ImageCaptureSource)

Called when a capture source is destroyed. Read more
Source§

impl ImageCopyCaptureHandler for AppState

ext-image-copy-capture: external clients capturing this compositor’s outputs.

A dmabuf-capable client gets the render formats of the GLES renderer and its frames are filled with one GPU blit from the output’s composited buffer; an shm client gets a readback. Frames complete from the render loop, never from a stale backbuffer.

Source§

fn image_copy_capture_state(&mut self) -> &mut ImageCopyCaptureState

Returns a mutable reference to the [ImageCopyCaptureState] delegate type.
Source§

fn capture_constraints( &mut self, source: &ImageCaptureSource, ) -> Option<BufferConstraints>

Return buffer constraints for capturing the given source. Read more
Source§

fn new_session(&mut self, session: CopySession)

Called when a new capture session is created. Read more
Source§

fn frame(&mut self, session: &CopySessionRef, frame: CopyFrame)

Called when a frame capture is requested. Read more
Source§

fn frame_aborted(&mut self, frame: CopyFrameRef)

Called when a frame is aborted (e.g., buffer destroyed before capture) or the client disconnects. Read more
Source§

fn session_destroyed(&mut self, session: CopySessionRef)

Called when a session is destroyed. Read more
§

fn cursor_capture_constraints( &mut self, source: &ImageCaptureSource, pointer: &WlPointer, ) -> Option<BufferConstraints>

Return buffer constraints for capturing the cursor on the given source. Read more
§

fn new_cursor_session(&mut self, session: CursorSession)

Called when a new cursor capture session is created.
§

fn cursor_frame(&mut self, session: &CursorSessionRef, frame: Frame)

Called when a cursor frame capture is requested.
§

fn cursor_session_destroyed(&mut self, session: CursorSessionRef)

Called when a cursor session is destroyed. Read more
Source§

impl KeyboardShortcutsInhibitHandler for AppState

xdg-activation protocol: hands out activation tokens and, on redemption, raises the target window.

token_created accepts every token. request_activation honors a token only while it is fresh (issued less than 10 seconds ago) so a stale or replayed token cannot steal focus, then raises the window whose surface matches to the top of the space.

Source§

fn new_inhibitor(&mut self, inhibitor: KeyboardShortcutsInhibitor)

An inhibitor is granted only to the window that holds the keyboard, so a client cannot take the session’s shortcuts away from behind another window.

Source§

fn keyboard_shortcuts_inhibit_state( &mut self, ) -> &mut KeyboardShortcutsInhibitState

[KeyboardShortcutsInhibitState] getter
§

fn inhibitor_destroyed(&mut self, inhibitor: KeyboardShortcutsInhibitor)

Inhibitor got destroyed
Source§

impl KeyboardTarget<AppState> for FocusTarget

Forward every keyboard event (enter / leave / key / modifiers) to the wrapped target’s underlying wl_surface, which carries Smithay’s real keyboard-target implementation; a subsurface’s events go to the surface it belongs to, since keyboard focus is a whole window’s.

Source§

fn enter( &self, seat: &Seat<AppState>, data: &mut AppState, keys: Vec<KeysymHandle<'_>>, serial: Serial, )

Keyboard focus of a given seat was assigned to this handler
Source§

fn leave(&self, seat: &Seat<AppState>, data: &mut AppState, serial: Serial)

The keyboard focus of a given seat left this handler
Source§

fn key( &self, seat: &Seat<AppState>, data: &mut AppState, key: KeysymHandle<'_>, state: KeyState, serial: Serial, time: InputTime, )

A key was pressed on a keyboard from a given seat
Source§

fn modifiers( &self, seat: &Seat<AppState>, data: &mut AppState, modifiers: ModifiersState, serial: Serial, )

Hold modifiers were changed on a keyboard from a given seat
§

fn replace( &self, replaced: <D as SeatHandler>::KeyboardFocus, seat: &Seat<D>, data: &mut D, keys: Vec<KeysymHandle<'_>>, modifiers: ModifiersState, serial: Serial, )

Keyboard focus of a given seat moved from another handler to this handler
Source§

impl OutputCaptureSourceHandler for AppState

Source§

fn output_capture_source_state(&mut self) -> &mut OutputCaptureSourceState

Returns a mutable reference to the [OutputCaptureSourceState].
Source§

fn output_source_created(&mut self, source: ImageCaptureSource, output: &Output)

Called when a capture source is created from an output. Read more
Source§

impl OutputHandler for AppState

Output protocol: a wl_output a client binds after the globals that name outputs enters the workspace group and the window handles on it, since those enters reach only the objects the client held when they were sent.

Source§

fn output_bound(&mut self, output: Output, wl_output: WlOutput)

A client bound a new wl_output instance.
Source§

impl PointerConstraintsHandler for AppState

Pointer-constraints protocol. A lock is activated for the surface the pointer already holds, and activate_constraint_under picks up one asked for ahead of the pointer when the motion that enters it arrives: SDL asks as relative mode goes on, which is before it has the pointer. Confinement regions and cursor-position hints are still accepted as no-ops.

Source§

fn new_constraint(&mut self, surface: &WlSurface, pointer: &PointerHandle<Self>)

Pointer lock or confinement constraint created for pointer on surface Read more
§

fn remove_constraint( &mut self, _surface: &WlSurface, _pointer: &PointerHandle<Self>, _constraint_remove: ConstraintRemove, )

Pointer constraint removed for pointer on surface Read more
§

fn cursor_position_hint( &mut self, _surface: &WlSurface, _pointer: &PointerHandle<Self>, _location: Point<f64, Logical>, )

The client holding a LockedPointer has committed a cursor position hint. Read more
Source§

impl PointerTarget<AppState> for FocusTarget

Forward every pointer event (motion, buttons, axis, and all swipe / pinch / hold gesture phases) to the wrapped target’s underlying wl_surface.

Source§

fn enter(&self, seat: &Seat<AppState>, data: &mut AppState, event: &MotionEvent)

A pointer of a given seat entered this handler
Source§

fn motion( &self, seat: &Seat<AppState>, data: &mut AppState, event: &MotionEvent, )

A pointer of a given seat moved over this handler
Source§

fn relative_motion( &self, seat: &Seat<AppState>, data: &mut AppState, event: &RelativeMotionEvent, )

A pointer of a given seat that provides relative motion moved over this handler
Source§

fn button( &self, seat: &Seat<AppState>, data: &mut AppState, event: &ButtonEvent, )

A pointer of a given seat clicked a button
Source§

fn axis(&self, seat: &Seat<AppState>, data: &mut AppState, frame: AxisFrame)

A pointer of a given seat scrolled on an axis
Source§

fn frame(&self, seat: &Seat<AppState>, data: &mut AppState)

End of a pointer frame
Source§

fn leave( &self, seat: &Seat<AppState>, data: &mut AppState, serial: Serial, time: InputTime, )

A pointer of a given seat left this handler
Source§

fn gesture_swipe_begin( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureSwipeBeginEvent, )

A pointer of a given seat started a swipe gesture
Source§

fn gesture_swipe_update( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureSwipeUpdateEvent, )

A pointer of a given seat updated a swipe gesture
Source§

fn gesture_swipe_end( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureSwipeEndEvent, )

A pointer of a given seat ended a swipe gesture
Source§

fn gesture_pinch_begin( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GesturePinchBeginEvent, )

A pointer of a given seat started a pinch gesture
Source§

fn gesture_pinch_update( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GesturePinchUpdateEvent, )

A pointer of a given seat updated a pinch gesture
Source§

fn gesture_pinch_end( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GesturePinchEndEvent, )

A pointer of a given seat ended a pinch gesture
Source§

fn gesture_hold_begin( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureHoldBeginEvent, )

A pointer of a given seat started a hold gesture
Source§

fn gesture_hold_end( &self, seat: &Seat<AppState>, data: &mut AppState, event: &GestureHoldEndEvent, )

A pointer of a given seat ended a hold gesture
§

fn replace( &self, replaced: <D as SeatHandler>::PointerFocus, seat: &Seat<D>, data: &mut D, event: &MotionEvent, )

A pointer of a given seat moved from another handler to this handler
Source§

impl PointerWarpHandler for AppState

Pointer-warp protocol: lets a client teleport the pointer to a surface-local position (games / remote-desktop style warps).

warp_pointer locates the requesting surface’s origin in the global space, adds the requested surface-local offset to get a global position, recomputes what element lies under it, and emits a synthetic motion event so focus and enter/leave follow the warp.

Source§

fn warp_pointer( &mut self, surface: WlSurface, _pointer: WlPointer, pos: Point<f64, Logical>, serial: Serial, )

Request the compositor to move the pointer to a surface-local position. Whether or not the compositor honors the request is implementation defined, but it should Read more
Source§

impl PrimarySelectionHandler for AppState

Carry the X11-style primary selection so middle-click paste works between clients. Exposing the managed state lets Smithay record which client currently owns the primary selection; focus_changed then keeps that ownership tracking keyboard focus, so a middle-click pastes from whichever client the user is actually working in.

Source§

fn primary_selection_state(&mut self) -> &mut PrimarySelectionState

[PrimarySelectionState] getter.
Source§

impl SeatHandler for AppState

Seat wiring: declares the keyboard / pointer / touch focus types and reacts to cursor changes and keyboard-focus moves.

Source§

fn cursor_image(&mut self, _seat: &Seat<AppState>, image: CursorImageStatus)

A client requested a cursor change (named, hidden, or surface-backed): retain it as the current icon and forward it to the Python cursor callback. A surface-backed one is delivered by the surface’s commit or by flush_pending_cursor, whichever is first.

Source§

fn focus_changed( &mut self, seat: &Seat<AppState>, focus: Option<&Self::KeyboardFocus>, )

Keep BOTH selections’ focus following keyboard focus: without the data-device half, the focused client never receives wl_data_offer events and Ctrl+V paste is a silent no-op even while the compositor-side selection is correct (primary covers only middle-click paste).

Source§

type KeyboardFocus = FocusTarget

Type used to represent the target currently holding the keyboard focus
Source§

type PointerFocus = FocusTarget

Type used to represent the target currently holding the pointer focus
Source§

type TouchFocus = FocusTarget

Type used to represent the target currently holding the touch focus
Source§

fn seat_state(&mut self) -> &mut SeatState<AppState>

[SeatState] getter
§

fn led_state_changed(&mut self, _seat: &Seat<Self>, _led_state: LedState)

Callback that will be notified whenever the keyboard led state changes.
§

fn click_grab( &mut self, start_data: GrabStartData<Self>, ) -> impl PointerGrab<Self>

Provides the implicit pointer grab for clicks Read more
§

fn touch_down_grab( &mut self, start_data: GrabStartData<Self>, ) -> impl TouchGrab<Self>

Provides the implicit touch grab for down events Read more
Source§

impl SelectionHandler for AppState

Selection (clipboard) bridge between Wayland clients and Python. SelectionUserData is the Python-owned payload, one (mime, bytes) entry per offered flavor, served to pasting clients when Python holds the selection.

Source§

fn new_selection( &mut self, ty: SelectionTarget, source: Option<SelectionSource>, seat: Seat<Self>, )

A client took the clipboard, or cleared it: pick the flavors to read and stage them for the loop.

Only client-owned clipboard (not primary) selections are relayed to Python. The source’s flavors (clipboard_flavors) are recorded in pending_clipboard_read, and a cleared selection as no flavors. The read itself is deferred: the new source is stored only after this handler returns, so process_pending_clipboard_read runs post-dispatch and reads the new selection rather than the previous one.

Source§

fn send_selection( &mut self, ty: SelectionTarget, mime_type: String, fd: OwnedFd, _seat: Seat<Self>, user_data: &Self::SelectionUserData, )

A client pastes the Python-owned selection: stream the stored bytes into the client’s fd on a spawned thread, since the receiving pipe may backpressure. Bounded by an idle deadline: a client that never reads its paste fd must not pin the thread.

Source§

type SelectionUserData = Arc<Vec<(String, Vec<u8>)>>

UserData attached to server-side selections.
Source§

impl ShmHandler for AppState

wl_shm protocol: exposes the shared-memory buffer state.

Source§

fn shm_state(&self) -> &ShmState

Return the Shm global state
Source§

impl TabletSeatHandler for AppState

No graphics tablets exist here (input is injected); the default no-op tool-image callback is all cursor-shape’s tablet half needs, and a tool would focus plain surfaces.

Source§

type ToolFocus = WlSurface

Type used to represent the target currently holding the tablet’s tool focus
§

fn tablet_tool_image( &mut self, tool: &TabletToolDescriptor, image: CursorImageStatus, )

Callback that will be notified whenever a client requests to set a custom tool image.
§

fn down_grab( &mut self, start_data: GrabStartData<Self>, ) -> impl TabletToolGrab<Self>

Provides the implicit tool grab for down events Read more
Source§

impl TouchTarget<AppState> for FocusTarget

Forward every touch event (down / up / motion / frame / cancel / shape / orientation) to the wrapped target’s underlying wl_surface.

Source§

fn down(&self, seat: &Seat<AppState>, data: &mut AppState, event: &DownEvent)

A new touch point has appeared on the target. Read more
Source§

fn up(&self, seat: &Seat<AppState>, data: &mut AppState, event: &UpEvent)

The touch point has disappeared. Read more
Source§

fn motion( &self, seat: &Seat<AppState>, data: &mut AppState, event: &MotionEvent, )

A touch point has changed coordinates.
Source§

fn frame(&self, seat: &Seat<AppState>, data: &mut AppState, marker: FrameMarker)

Indicates the end of a set of events that logically belong together. Read more
Source§

fn cancel( &self, seat: &Seat<AppState>, data: &mut AppState, marker: FrameMarker, )

Touch session cancelled. Read more
Source§

fn shape(&self, seat: &Seat<AppState>, data: &mut AppState, event: &ShapeEvent)

Sent when a touch point has changed its shape. Read more
Source§

fn orientation( &self, seat: &Seat<AppState>, data: &mut AppState, event: &OrientationEvent, )

Sent when a touch point has changed its orientation. Read more
Source§

fn last_frame( &self, seat: &Seat<AppState>, data: &mut AppState, ) -> Option<FrameMarker>

Returns last know [FrameMarker]. Read more
Source§

impl WaylandDndGrabHandler for AppState

wl_data_device.start_drag: a client’s drag becomes Smithay’s drag-and-drop grab on the pointer or the touch point that started it, which offers the source to the surface under it, Wayland or X11 through the X11 window manager’s bridge, and drops it on release; its icon is drawn at the pointer until then (AppState::dnd_icon). The trait’s own default cancels every drag, which left a drag between two windows, or out of one, ending as it began.

Source§

fn dnd_requested<S: Source>( &mut self, source: S, icon: Option<WlSurface>, seat: Seat<Self>, serial: Serial, type_: GrabType, )

A client requested a drag’n’drop as response to a user pointer action Read more
Source§

impl WlrLayerShellHandler for AppState

wlr-layer-shell protocol: places panels / overlays / backgrounds (layer surfaces).

new_layer_surface resolves the requested output (or the first output), configures the surface to that output’s full pixel size, and maps it into the output’s layer map so the render loop composites it in the correct z-order. layer_destroyed drops the surface from every layer map and arranges them again, so the work areas give back what it reserved.

Source§

fn shell_state(&mut self) -> &mut WlrLayerShellState

[WlrLayerShellState] getter
Source§

fn new_layer_surface( &mut self, surface: WlrLayerSurface, output: Option<WlOutput>, _layer: WlrLayer, namespace: String, )

A new layer surface was created Read more
Source§

fn layer_destroyed(&mut self, _surface: WlrLayerSurface)

A layer surface was destroyed. Read more
§

fn new_popup(&mut self, parent: LayerSurface, popup: PopupSurface)

A new popup was assigned a layer surface as it’s parent
§

fn ack_configure( &mut self, surface: WlSurface, configure: LayerSurfaceConfigure, )

A surface has acknowledged a configure serial.
Source§

impl XWaylandShellHandler for AppState

Source§

fn xwayland_shell_state(&mut self) -> &mut XWaylandShellState

Retrieves the global state.
§

fn surface_associated( &mut self, xwm: XwmId, wl_surface: WlSurface, surface: X11Surface, )

An X11 window has been associated with a wayland surface. This doesn’t take effect until the wl_surface is committed.
Source§

impl XdgActivationHandler for AppState

Source§

fn activation_state(&mut self) -> &mut XdgActivationState

Returns the activation state.
Source§

fn token_created( &mut self, _token: XdgActivationToken, _data: XdgActivationTokenData, ) -> bool

A client has created a new token. Read more
Source§

fn request_activation( &mut self, _token: XdgActivationToken, token_data: XdgActivationTokenData, surface: WlSurface, )

A client has requested surface activation. Read more
Source§

impl XdgDecorationHandler for AppState

Default every toplevel to server-side decorations so clients don’t bake their own title bars and borders into the captured image.

The frontend shows fullscreen application content with no window-manager chrome, so a client left to draw client-side decorations would paint a stray title bar straight into the encoded frame. Pinning the negotiation to Mode::ServerSide (in new_decoration, and again when a client unsets its preference in unset_mode) hands decoration duty to the compositor — which draws none — leaving clean, borderless output; request_mode still grants a mode a client explicitly insists on. Each path acknowledges with a configure.

Source§

fn new_decoration(&mut self, toplevel: ToplevelSurface)

Notification the client supports server side decoration on the toplevel.
Source§

fn request_mode(&mut self, toplevel: ToplevelSurface, mode: Mode)

Notification the client prefers the provided decoration decoration mode on the toplevel.
Source§

fn unset_mode(&mut self, toplevel: ToplevelSurface)

Notification the client does not prefer a particular decoration mode on the toplevel.
Source§

impl XdgShellHandler for AppState

xdg-shell protocol: toplevel and popup lifecycle.

Source§

fn new_toplevel(&mut self, surface: ToplevelSurface)

A new toplevel appears: wrap it in a Window, queue it for mapping, and register a foreign-toplevel handle (seeded with title / app-id) stored on the surface for later updates. The window is pinned to the pointer’s output HERE — the first commit can’t be relied on for that, because a decoration-negotiating client (foot) has its initial configure sent by new_decoration before it ever commits, skipping the pre-configure commit branch.

Source§

fn new_popup(&mut self, surface: PopupSurface, _positioner: PositionerState)

Register a new popup (menu, tooltip, combo-box list) with the PopupManager so it takes part in grab and dismissal handling, then send the initial configure xdg-shell requires before the client is allowed to draw it.

Source§

fn grab(&mut self, surface: PopupSurface, _seat: WlSeat, serial: Serial)

Popup grab: find the popup’s root surface and its window or layer surface, then install a popup grab so dismissal and pointer routing behave correctly.

Source§

fn reposition_request( &mut self, surface: PopupSurface, _positioner: PositionerState, token: u32, )

Re-track a popup whose position changed (e.g. a submenu flipping sides to stay on-screen) so the PopupManager follows its new geometry, then echo the client’s reposition token back to confirm the move took effect.

Source§

fn fullscreen_request( &mut self, surface: ToplevelSurface, output: Option<WlOutput>, )

Client fullscreen request: always granted at the compositor’s forced-fullscreen geometry (the CURRENT logical size), so the toggle gets a definite answer. A request naming an output moves the window there, which is how a nested compositor puts each of its screens on a monitor of its choosing.

Source§

fn unfullscreen_request(&mut self, surface: ToplevelSurface)

Client unfullscreen request: the forced-fullscreen policy stands, but the client still receives an explicit configure at the current geometry (the Smithay default sends NOTHING here, leaving the app waiting on a toggle that never answers).

Source§

fn maximize_request(&mut self, surface: ToplevelSurface)

Maximize request: the policy’s where one is installed, else the forced-fullscreen configure (same geometry).

Source§

fn unmaximize_request(&mut self, surface: ToplevelSurface)

Unmaximize request: the policy’s, else an explicit current-geometry configure.

Source§

fn minimize_request(&mut self, surface: ToplevelSurface)

Minimize request: the policy’s; without one every window stays as it is.

Source§

fn move_request( &mut self, surface: ToplevelSurface, _seat: WlSeat, _serial: Serial, )

An interactive move the client started from a button it holds: the policy’s drag.

Source§

fn resize_request( &mut self, surface: ToplevelSurface, _seat: WlSeat, _serial: Serial, edges: ResizeEdge, )

An interactive resize the client started: the policy’s drag on the named edge.

Source§

fn show_window_menu( &mut self, surface: ToplevelSurface, _seat: WlSeat, _serial: Serial, location: Point<i32, Logical>, )

The client asks for its window menu: the policy’s, at the point in the window.

Source§

fn title_changed(&mut self, surface: ToplevelSurface)

The title changed: the policy’s frame and the taskbars follow.

Source§

fn app_id_changed(&mut self, surface: ToplevelSurface)

The app id changed: the policy’s frame icon and the taskbars follow.

Source§

fn parent_changed(&mut self, surface: ToplevelSurface)

The parent changed: the policy stacks and places the dialog over it.

Source§

fn toplevel_destroyed(&mut self, surface: ToplevelSurface)

A toplevel closed: drop it from the pending-window queue so a window that never finished mapping can’t linger there, unmap it from the space at once so list_windows and hit-testing never see a husk (the periodic space.refresh would only reap it later), and remove its foreign-toplevel handle so taskbar-style clients stop listing a window that is gone.

Source§

fn xdg_shell_state(&mut self) -> &mut XdgShellState

[XdgShellState] getter
§

fn new_client(&mut self, client: ShellClient)

A new shell client was instantiated
§

fn client_pong(&mut self, client: ShellClient)

The pong for a pending ping of this shell client was received Read more
§

fn ack_configure(&mut self, surface: WlSurface, configure: Configure)

A surface has acknowledged a configure serial.
§

fn client_destroyed(&mut self, client: ShellClient)

A shell client was destroyed. Read more
§

fn popup_destroyed(&mut self, surface: PopupSurface)

A popup surface was destroyed. Read more
Source§

impl XwmHandler for AppState

Source§

fn xwm_state(&mut self, _xwm: XwmId) -> &mut X11Wm

[X11Wm] getter for a given ID.
Source§

fn new_window(&mut self, _xwm: XwmId, _window: X11Surface)

A new X11 window was created. Read more
Source§

fn new_override_redirect_window(&mut self, _xwm: XwmId, _window: X11Surface)

A new X11 window with the override redirect flag. Read more
Source§

fn map_window_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be mapped. Read more
Source§

fn map_window_notify(&mut self, _xwm: XwmId, _window: X11Surface)

Notification a window was mapped successfully
Source§

fn mapped_override_redirect_window(&mut self, _xwm: XwmId, surface: X11Surface)

Override redirect window was mapped. Read more
Source§

fn unmapped_window(&mut self, _xwm: XwmId, surface: X11Surface)

Window was unmapped.
Source§

fn destroyed_window(&mut self, _xwm: XwmId, surface: X11Surface)

Window was destroyed
Source§

fn configure_request( &mut self, _xwm: XwmId, surface: X11Surface, x: Option<i32>, y: Option<i32>, w: Option<u32>, h: Option<u32>, reorder: Option<Reorder>, )

Window asks to be positioned or sized differently. Read more
Source§

fn configure_notify( &mut self, _xwm: XwmId, surface: X11Surface, geometry: Rectangle<i32, Logical>, _above: Option<u32>, )

Window was reconfigured. Read more
Source§

fn property_notify( &mut self, _xwm: XwmId, surface: X11Surface, property: WmWindowProperty, )

A window property has changed.
Source§

fn maximize_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be maximized.
Source§

fn unmaximize_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be unmaximized.
Source§

fn fullscreen_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be fullscreened.
Source§

fn unfullscreen_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be unfullscreened.
Source§

fn minimize_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be minimized.
Source§

fn unminimize_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be unminimized.
Source§

fn above_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be placed above other windows.
Source§

fn unabove_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to no longer be placed above other windows.
Source§

fn below_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be placed below other windows.
Source§

fn unbelow_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to no longer be placed below other windows.
Source§

fn shade_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be shaded.
Source§

fn unshade_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window requests to be unshaded.
Source§

fn demands_attention_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window indicates it requires the user’s attention.
Source§

fn undemands_attention_request(&mut self, _xwm: XwmId, surface: X11Surface)

Window no longer indicates it requires the user’s attention.
Source§

fn resize_request( &mut self, _xwm: XwmId, surface: X11Surface, _button: u32, edges: X11ResizeEdge, )

Window requests to be resized. Read more
Source§

fn move_request(&mut self, _xwm: XwmId, surface: X11Surface, _button: u32)

Window requests to be moved. Read more
Source§

fn active_window_request( &mut self, _xwm: XwmId, surface: X11Surface, _timestamp: u32, _current: Option<X11Surface>, )

Window requests to be set as active window. Read more
Source§

fn allow_selection_access( &mut self, xwm: XwmId, _selection: SelectionTarget, ) -> bool

Window requests access to the given selection.
Source§

fn send_selection( &mut self, _xwm: XwmId, selection: SelectionTarget, mime_type: String, fd: OwnedFd, )

The given selection is being read by an X client and needs to be written to the provided file descriptor
Source§

fn new_selection( &mut self, _xwm: XwmId, selection: SelectionTarget, mime_types: Vec<String>, )

A new selection was set by an X client with provided mime_types
Source§

fn cleared_selection(&mut self, _xwm: XwmId, selection: SelectionTarget)

A proviously set selection of an X client got cleared
Source§

fn show_desktop_request(&mut self, _xwm: XwmId)

Application requests enabling “show desktop” mode
Source§

fn unshow_desktop_request(&mut self, _xwm: XwmId)

Application requests disabling “show desktop” mode
Source§

fn disconnected(&mut self, _xwm: XwmId)

WM has lost connection to X server
§

fn modal_request(&mut self, xwm: XwmId, window: X11Surface)

Window requests to be set as a modal dialog (see [X11Surface::is_modal]).
§

fn unmodal_request(&mut self, xwm: XwmId, window: X11Surface)

Window requests to no longer be a modal dialog.
§

fn stick_request(&mut self, xwm: XwmId, window: X11Surface)

Window requests to be made sticky. Read more
§

fn unstick_request(&mut self, xwm: XwmId, window: X11Surface)

Window requests to be unstuck.
§

fn ping_acked(&mut self, xwm: XwmId, window: X11Surface, timestamp: u32)

Window has responded to a _NET_WM_PING request.
§

fn sync_request_acked(&mut self, xwm: XwmId, window: X11Surface)

A client has acknowledged a _NET_WM_SYNC_REQUEST request. Read more
§

fn sync_request_timeout(&mut self, xwm: XwmId, window: X11Surface)

A client’s _NET_WM_SYNC_REQUEST has timed out. Read more
§

fn randr_primary_output_change( &mut self, xwm: XwmId, output_name: Option<String>, )

The primary output of the randr protocol state was updated

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more