pub struct WlSubsurface { /* private fields */ }Expand description
sub-surface interface to a wl_surface
An additional interface to a wl_surface object, which has been made a sub-surface. A sub-surface has one parent surface. A sub-surface’s size and position are not limited to that of the parent. Particularly, a sub-surface is not automatically clipped to its parent’s area.
A sub-surface becomes mapped, when a non-NULL wl_buffer is applied and the parent surface is mapped. The order of which one happens first is irrelevant. A sub-surface is hidden if the parent becomes hidden, or if a NULL wl_buffer is applied. These rules apply recursively through the tree of surfaces.
A sub-surface can be in one of two modes. The possible modes are synchronized and desynchronized, see methods wl_subsurface.set_sync and wl_subsurface.set_desync.
The main surface can be thought to be always in desynchronized mode, since it does not have a parent in the sub-surfaces sense.
Even if a sub-surface is in desynchronized mode, it will behave as in synchronized mode, if its parent surface behaves as in synchronized mode. This rule is applied recursively throughout the tree of surfaces. This means, that one can set a sub-surface into synchronized mode, and then assume that all its child and grand-child sub-surfaces are synchronized, too, without explicitly setting them.
If a surface behaves as in synchronized mode, it is effectively synchronized, otherwise it is effectively desynchronized.
A sub-surface is initially in the synchronized mode.
The wl_subsurface interface has requests which modify double-buffered state of the parent surface (wl_subsurface.set_position, .place_above and .place_below).
Destroying a sub-surface takes effect immediately. If you need to synchronize the removal of a sub-surface to the parent surface update, unmap the sub-surface first by attaching a NULL wl_buffer, update parent, and then destroy the sub-surface.
If the parent wl_surface object is destroyed, the sub-surface is unmapped.
A sub-surface never has the keyboard focus of any seat.
The wl_surface.offset request is ignored: clients must use set_position instead to move the sub-surface.
This interface has no events.
Implementations§
Source§impl WlSubsurface
impl WlSubsurface
Sourcepub fn destroy(&self)
pub fn destroy(&self)
remove sub-surface interface
The sub-surface interface is removed from the wl_surface object that was turned into a sub-surface with a wl_subcompositor.get_subsurface request. The wl_surface’s association to the parent is deleted. The wl_surface is unmapped immediately.
Sourcepub fn set_position(&self, x: i32, y: i32)
pub fn set_position(&self, x: i32, y: i32)
reposition the sub-surface
This sets the position of the sub-surface, relative to the parent surface.
The sub-surface will be moved so that its origin (top left corner pixel) will be at the location x, y of the parent surface coordinate system. The coordinates are not restricted to the parent surface area. Negative values are allowed.
The initial position is 0, 0.
Position is double-buffered state on the parent surface, see wl_subsurface and wl_surface.commit for more information.
Sourcepub fn place_above(&self, sibling: &WlSurface)
pub fn place_above(&self, sibling: &WlSurface)
restack the sub-surface
This sub-surface is taken from the stack, and put back just above the reference surface, changing the z-order of the sub-surfaces. The reference surface must be one of the sibling surfaces, or the parent surface. Using any other surface, including this sub-surface, will cause a protocol error.
A new sub-surface is initially added as the top-most in the stack of its siblings and parent.
Z-order is double-buffered state on the parent surface, see wl_subsurface and wl_surface.commit for more information.
Sourcepub fn place_below(&self, sibling: &WlSurface)
pub fn place_below(&self, sibling: &WlSurface)
restack the sub-surface
The sub-surface is placed just below the reference surface.
See wl_subsurface.place_above.
Sourcepub fn set_sync(&self)
pub fn set_sync(&self)
set sub-surface to synchronized mode
Change the commit behaviour of the sub-surface to synchronized mode.
See wl_subsurface and wl_surface.commit for more information.
Sourcepub fn set_desync(&self)
pub fn set_desync(&self)
set sub-surface to desynchronized mode
Change the commit behaviour of the sub-surface to desynchronized mode.
See wl_subsurface and wl_surface.commit for more information.
Trait Implementations§
Source§impl Borrow<ObjectId> for WlSubsurface
impl Borrow<ObjectId> for WlSubsurface
Source§impl Clone for WlSubsurface
impl Clone for WlSubsurface
Source§fn clone(&self) -> WlSubsurface
fn clone(&self) -> WlSubsurface
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WlSubsurface
impl Debug for WlSubsurface
Source§impl Hash for WlSubsurface
impl Hash for WlSubsurface
Source§impl PartialEq<Weak<WlSubsurface>> for WlSubsurface
impl PartialEq<Weak<WlSubsurface>> for WlSubsurface
Source§impl PartialEq for WlSubsurface
impl PartialEq for WlSubsurface
Source§impl Proxy for WlSubsurface
impl Proxy for WlSubsurface
Source§fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
Source§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
Source§fn backend(&self) -> &WeakBackend
fn backend(&self) -> &WeakBackend
Source§fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
Source§fn send_constructor<I: Proxy>(
&self,
req: Self::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>
fn send_constructor<I: Proxy>( &self, req: Self::Request<'_>, data: Arc<dyn ObjectData>, ) -> Result<I, InvalidId>
Source§fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
Source§fn inert(backend: WeakBackend) -> Self
fn inert(backend: WeakBackend) -> Self
Source§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(Self, Self::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Event), DispatchError>
Source§fn write_request<'a>(
&self,
conn: &Connection,
msg: Self::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: Self::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for WlSubsurface
Auto Trait Implementations§
impl Freeze for WlSubsurface
impl !RefUnwindSafe for WlSubsurface
impl Send for WlSubsurface
impl Sync for WlSubsurface
impl Unpin for WlSubsurface
impl !UnwindSafe for WlSubsurface
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.