Skip to main content

AgentSeat

Struct AgentSeat 

Source
pub struct AgentSeat { /* private fields */ }
Expand description

Private Wayland proxy that owns its socket, worker threads, and bridges.

Implementations§

Source§

impl AgentSeat

Source

pub fn create() -> Result<Arc<Self>, SeatError>

Create and start an independently owned agent seat.

Source

pub fn socket_name(&self) -> String

The WAYLAND_DISPLAY value agent-launched apps must use.

Source

pub fn configure_command<'a>(&self, command: &'a mut Command) -> &'a mut Command

Configure a process to connect through this private Wayland seat.

Source

pub fn close(&self)

Stop this seat, close every proxied connection, and reap bridge threads. Calling this more than once is safe.

Source

pub fn start_xwayland_bridge( &self, width: u16, height: u16, ) -> Result<XwaylandBridge, SeatError>

Start an owner-authenticated XWayland server whose single root window is itself a client of this seat. -shm makes its pixels readable by the window-scoped capture path, while the Xauthority cookie prevents other local users from connecting to the temporary X socket.

Source

pub fn adopt_xwayland_bridge( &self, bridge: XwaylandBridge, ) -> Result<(), SeatError>

Transfer a successful bridge to the seat. Closing the seat connection makes XWayland exit; the owned reaper then removes only this bridge’s credential directory.

Source

pub fn app(&self, pid: u32) -> Option<Arc<SeatApp>>

The proxied app with the given pid, when connected.

Source

pub fn bind_app(&self, app: &Arc<SeatApp>)

Pin subsequent lookups for the app’s pid to this exact connection.

Source

pub fn bind_app_for_pid(&self, application_pid: u32, app: &Arc<SeatApp>)

Bind an application pid to the seat connection that transports its pixels and input. Normally both pids are identical; an XWayland bridge deliberately transports an X11 client’s window on its behalf.

Source

pub fn most_recent_app(&self) -> Option<Arc<SeatApp>>

The most recently connected proxied app. Used as a fallback when the bound target’s pid does not match the connected peer’s pid (apps that re-exec or connect from a child process).

Source

pub fn connected_pids(&self) -> HashSet<u32>

The set of currently connected app pids.

Source

pub fn app_count(&self) -> usize

Number of connected proxied apps.

Source

pub fn new_capturable_app(&self, before: &HashSet<u32>) -> Option<Arc<SeatApp>>

Wait until a connection from a pid NOT in before has a readable frame. Electron can open multiple Wayland connections under one pid; binding only the first one can select a helper with no visible surface.

Source

pub fn wait_new_capturable_app( &self, before: &HashSet<u32>, timeout: Duration, ) -> Option<Arc<SeatApp>>

Wait until a connection from a pid not present in before has a readable application-sized frame.

Trait Implementations§

Source§

impl Drop for AgentSeat

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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

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

Source§

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

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

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

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> DowncastSync for T
where T: Any + Send + Sync,

Source§

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.

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