pub struct ForeignToplevelHandle { /* private fields */ }wayland_frontend only.Expand description
Handle of a toplevel, used to update title or app_id, after initial handle creation
eg.
use smithay::wayland::foreign_toplevel_list::ForeignToplevelHandle;
let handle: ForeignToplevelHandle = todo!();
// Handle can be used to update title and app_id
handle.send_title("abc");
handle.send_app_id("com.example");
handle.send_done();
// Handle can also be used to close the window, after this call the handle will become inert,
// and the handle will no longer be announced to clients
handle.send_closed();Implementations§
Source§impl ForeignToplevelHandle
impl ForeignToplevelHandle
Sourcepub fn downgrade(&self) -> ForeignToplevelWeakHandle
pub fn downgrade(&self) -> ForeignToplevelWeakHandle
Downgrade strong ForeignToplevelHandle to weak ForeignToplevelWeakHandle
Sourcepub fn from_resource(resource: &ExtForeignToplevelHandleV1) -> Option<Self>
pub fn from_resource(resource: &ExtForeignToplevelHandleV1) -> Option<Self>
Attempt to retrieve ForeignToplevelHandle from an existing resource
Sourcepub fn resources(&self) -> Vec<ExtForeignToplevelHandleV1>
pub fn resources(&self) -> Vec<ExtForeignToplevelHandleV1>
Retrieve ExtForeignToplevelHandleV1
instances for this handle.
Sourcepub fn resources_for_client(
&self,
client: &Client,
) -> Vec<ExtForeignToplevelHandleV1>
pub fn resources_for_client( &self, client: &Client, ) -> Vec<ExtForeignToplevelHandleV1>
Retrieve ExtForeignToplevelHandleV1
instances for this handle of a given Client.
Sourcepub fn user_data(&self) -> &UserDataMap
pub fn user_data(&self) -> &UserDataMap
Access the UserDataMap associated with this ForeignToplevelHandle
Sourcepub fn send_title(&self, title: &str)
pub fn send_title(&self, title: &str)
The title of the toplevel has changed.
Self::send_done has to be called to finalize the update
Sourcepub fn send_app_id(&self, app_id: &str)
pub fn send_app_id(&self, app_id: &str)
The app_id of the toplevel has changed.
Self::send_done has to be called to finalize the update
Sourcepub fn send_done(&self)
pub fn send_done(&self)
This event is should be sent after all changes in the toplevel state have been sent.
Sourcepub fn send_closed(&self)
pub fn send_closed(&self)
The toplevel has been closed
Sourcepub fn identifier(&self) -> String
pub fn identifier(&self) -> String
A stable identifier for a toplevel
Trait Implementations§
Source§impl Clone for ForeignToplevelHandle
impl Clone for ForeignToplevelHandle
Source§fn clone(&self) -> ForeignToplevelHandle
fn clone(&self) -> ForeignToplevelHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ForeignToplevelHandle
impl Debug for ForeignToplevelHandle
Source§impl<D: ForeignToplevelListHandler> Dispatch<ExtForeignToplevelHandleV1, ForeignToplevelHandle, D> for ForeignToplevelListState
impl<D: ForeignToplevelListHandler> Dispatch<ExtForeignToplevelHandleV1, ForeignToplevelHandle, D> for ForeignToplevelListState
Source§fn request(
_state: &mut D,
_client: &Client,
_context: &ExtForeignToplevelHandleV1,
request: Request,
_data: &ForeignToplevelHandle,
_dh: &DisplayHandle,
_data_init: &mut DataInit<'_, D>,
)
fn request( _state: &mut D, _client: &Client, _context: &ExtForeignToplevelHandleV1, request: Request, _data: &ForeignToplevelHandle, _dh: &DisplayHandle, _data_init: &mut DataInit<'_, D>, )
Source§fn destroyed(
_state: &mut D,
_client: ClientId,
resource: &ExtForeignToplevelHandleV1,
handle: &ForeignToplevelHandle,
)
fn destroyed( _state: &mut D, _client: ClientId, resource: &ExtForeignToplevelHandleV1, handle: &ForeignToplevelHandle, )
Auto Trait Implementations§
impl Freeze for ForeignToplevelHandle
impl RefUnwindSafe for ForeignToplevelHandle
impl Send for ForeignToplevelHandle
impl Sync for ForeignToplevelHandle
impl Unpin for ForeignToplevelHandle
impl UnwindSafe for ForeignToplevelHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.