Skip to main content

ThreadCommand

Enum ThreadCommand 

Source
pub enum ThreadCommand {
Show 33 variants StartCapture { display_id: u32, callback: Option<Py<PyAny>>, settings: RustCaptureSettings, }, StopCapture { display_id: u32, }, CreateOutput { id: u32, width: i32, height: i32, x: i32, y: i32, scale: f64, reply: Sender<bool>, }, DestroyOutput { id: u32, reply: Sender<bool>, }, RepositionOutput { id: u32, x: i32, y: i32, reply: Sender<bool>, }, ListOutputs { reply: Sender<Vec<OutputDesc>>, }, OutputCapacity { reply: Sender<i64>, }, MoveWindowToOutput { window_id: u32, output_id: u32, reply: Sender<bool>, }, ListWindows { reply: Sender<Vec<WindowDesc>>, }, SetCursorCallback(Py<PyAny>), SetClipboardCallback(Py<PyAny>), SetClipboard { mime: String, data: Vec<u8>, }, KeyboardKey { scancode: u32, state: u32, }, KeyboardKeys { events: Vec<(u32, u32)>, }, SetKeymapString(String), SetXkbLayout { rules: String, model: String, layout: String, variant: String, options: String, reply: Sender<bool>, }, BindKeysyms { keysyms: Vec<u32>, reply: Sender<Vec<(u32, u32)>>, }, SetKeymapOverlay { binds: Vec<(u32, u32)>, }, GetKeyboardState { reply: Sender<(Vec<u32>, u32)>, }, GetXkbKeymap { reply: Sender<String>, }, Barrier { reply: Sender<()>, }, PointerMotion { x: f64, y: f64, }, PointerRelativeMotion { dx: f64, dy: f64, }, PointerButton { btn: u32, state: u32, }, PointerAxis { x: f64, y: f64, }, UpdateCursorConfig { render_on_framebuffer: bool, }, SetCursorSize { size: i32, reply: Sender<bool>, }, RequestIdr { display_id: u32, }, UpdateRate { display_id: u32, bitrate_kbps: Option<i32>, vbv_multiplier: Option<f64>, fps: Option<f64>, }, UpdateTunables { display_id: u32, tunables: LiveTunables, }, CuScreenshot { display_id: u32, resp: Sender<Result<Vec<u8>, String>>, }, CuCursorPosition { resp: Sender<(f64, f64)>, }, CuGetInfo { display_id: u32, resp: Sender<(i32, i32, f64)>, },
}
Expand description

Control messages sent from the Python-facing methods to the capture thread.

Every interaction with a running capture crosses the thread boundary as one of these variants over the command channel: starting and stopping, injecting keyboard / pointer input, swapping the xkb keymap, serving the clipboard, changing live rate and per-frame tunables, and the computer-use queries that read back the screen, cursor, and geometry.

Variants§

§

StartCapture

Start (or in-place reconfigure) the capture bound to output display_id. callback is the Python per-frame delivery target; None starts an internal capture with no Python consumer (the built-in recorder taps the delivery layer).

Fields

§display_id: u32
§callback: Option<Py<PyAny>>
§

StopCapture

Stop the capture bound to output display_id (other displays keep running).

Fields

§display_id: u32
§

CreateOutput

Create an additional output: WxH physical pixels at fractional scale, mapped into the layout at offset (x, y). Replies false when the id is taken/reserved or the GPU render target cannot be allocated.

Fields

§id: u32
§width: i32
§height: i32
§scale: f64
§reply: Sender<bool>
§

DestroyOutput

Destroy a secondary output: its capture ends, its windows relocate to the primary output. Replies false for the primary (id 0) or an unknown id.

Fields

§id: u32
§reply: Sender<bool>
§

RepositionOutput

Remap an existing output (the primary included) to layout offset (x, y): the Space mapping, the offsets used for absolute input injection and cursor compositing, and the windows placed on it all follow, and the output is damaged so the next frames render correctly. Replies false for an unknown id.

Fields

§id: u32
§reply: Sender<bool>
§

ListOutputs

Reply with every live output as (id, x, y, width, height, scale, capturing).

Fields

§

OutputCapacity

Reply with how many displays this backend can back with real content: -1 when self-compositing (outputs are created on demand), the host compositor’s output count in host-capture mode.

Fields

§reply: Sender<i64>
§

MoveWindowToOutput

Move the window with the given id onto output output_id (fullscreened there).

Fields

§window_id: u32
§output_id: u32
§reply: Sender<bool>
§

ListWindows

Reply with every mapped window as (window_id, title, app_id, output_id).

Fields

§

SetCursorCallback(Py<PyAny>)

§

SetClipboardCallback(Py<PyAny>)

§

SetClipboard

Server-side clipboard offer: the compositor owns the selection and serves data as mime (plus text aliases) to pasting clients.

Fields

§mime: String
§data: Vec<u8>
§

KeyboardKey

Fields

§scancode: u32
§state: u32
§

KeyboardKeys

A whole ordered run of key events in one message. Typing a paste one event at a time costs a channel send and a calloop wake per event, which competes with the render loop on the same thread; the caller still decides the sequence.

Fields

§events: Vec<(u32, u32)>
§

SetKeymapString(String)

Set the seat’s BASE keymap from a full XKB_KEYMAP_FORMAT_TEXT_V1 string. The compositor’s keymap policy rebuilds on top: overlay binds are re-spliced onto the new base (same keycodes) and the combined keymap is applied in one swap.

§

SetXkbLayout

Set the seat’s BASE layout from RMLVO names (empty strings = xkbcommon defaults); replies whether compilation succeeded. Overlay binds rebuild on top as for SetKeymapString.

Fields

§rules: String
§model: String
§layout: String
§variant: String
§options: String
§reply: Sender<bool>
§

BindKeysyms

Resolve keysyms to (keycode, level) against the seat keymap, overlay-binding every keysym the base cannot produce — ONE keymap swap for the whole batch, and a keycode that is currently pressed is never recycled. (0, 0) marks an unbindable keysym. Serves computer-use only; selkies resolves its own keysyms and injects plain keycodes.

Fields

§keysyms: Vec<u32>
§reply: Sender<Vec<(u32, u32)>>
§

SetKeymapOverlay

Bind explicit (keycode, keysym) pairs onto the CURRENT base keymap and deliver it, in one swap. The caller decides the assignment; this only assembles and applies, so the base is neither re-sent nor recompiled and its reverse map is not rebuilt. Ordered with key events on the one command channel, so the keys that need the new binds cannot overtake it — no reply is awaited, and the caller’s loop is never blocked on the swap.

Fields

§binds: Vec<(u32, u32)>
§

GetKeyboardState

Debug/verification readback: currently pressed xkb keycodes plus the modifier state bitmask (1 ctrl, 2 shift, 4 alt, 8 logo, 16 caps, 32 num, 64 altgr, 128 level5).

Fields

§reply: Sender<(Vec<u32>, u32)>
§

GetXkbKeymap

Reply with the smithay keyboard’s keymap as an XKB_KEYMAP_FORMAT_TEXT_V1 string so a consumer (selkies) can build its reverse keysym map from the IDENTICAL keymap.

Fields

§

Barrier

Ack once every previously queued command has been fully processed (the channel is FIFO). The atexit sweep sends StopCapture + Barrier and waits, so the interpreter never exits while the calloop thread is still mid-teardown (an NVENC/CUDA session drop racing process exit segfaults).

Fields

§reply: Sender<()>
§

PointerMotion

Fields

§

PointerRelativeMotion

Fields

§dx: f64
§dy: f64
§

PointerButton

btn is an evdev BTN_ code by contract (e.g. 272 = BTN_LEFT, 273 = BTN_RIGHT, 274 = BTN_MIDDLE, 0x113 = BTN_SIDE / 0x114 = BTN_EXTRA for back/forward) and is passed straight through to smithay’s pointer.

Fields

§btn: u32
§state: u32
§

PointerAxis

Fields

§

UpdateCursorConfig

Fields

§render_on_framebuffer: bool
§

SetCursorSize

Recreate the cursor theme handles at a new pixel size — the calloop’s compositing helper (the burned-in cursor) and, through its job channel, the wl-cursor worker’s (named-cursor PNG delivery). Replies false for a non-positive size.

Fields

§size: i32
§reply: Sender<bool>
§

RequestIdr

On-demand keyframe request (client reconnect / decoder reset) for one display’s capture: forces a send and an IDR even on a static screen.

Fields

§display_id: u32
§

UpdateRate

Live rate-control change for one display’s capture (parity with the X11 rate_dirty path). Each field is None when that dimension is unchanged.

Fields

§display_id: u32
§bitrate_kbps: Option<i32>
§vbv_multiplier: Option<f64>
§

UpdateTunables

Live per-frame tunables (quality / paint-over / streaming / cursor) for one display’s capture, mirrored to its readback encode thread — no restart.

Fields

§display_id: u32
§tunables: LiveTunables
§

CuScreenshot

One-shot PNG of one output’s next rendered frame (0 = primary); an unknown display id replies with an error immediately.

Fields

§display_id: u32
§

CuCursorPosition

Fields

§resp: Sender<(f64, f64)>
§

CuGetInfo

Fields

§display_id: u32
§resp: Sender<(i32, i32, f64)>

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.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> Same for T

Source§

type Output = T

Should always be Self
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> Ungil for T
where T: Send,

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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