Struct wayland_protocols::ext::session_lock::v1::server::ext_session_lock_v1::ExtSessionLockV1
source · pub struct ExtSessionLockV1 { /* private fields */ }
Expand description
manage lock state and create lock surfaces
In response to the creation of this object the compositor must send either the locked or finished event.
The locked event indicates that the session is locked. This means that the compositor must stop rendering and providing input to normal clients. Instead the compositor must blank all outputs with an opaque color such that their normal content is fully hidden.
The only surfaces that should be rendered while the session is locked are the lock surfaces created through this interface and optionally, at the compositor’s discretion, special privileged surfaces such as input methods or portions of desktop shell UIs.
The locked event must not be sent until a new “locked” frame (either from a session lock surface or the compositor blanking the output) has been presented on all outputs and no security sensitive normal/unlocked content is possibly visible.
The finished event should be sent immediately on creation of this object if the compositor decides that the locked event will not be sent.
The compositor may wait for the client to create and render session lock surfaces before sending the locked event to avoid displaying intermediate blank frames. However, it must impose a reasonable time limit if waiting and send the locked event as soon as the hard requirements described above can be met if the time limit expires. Clients should immediately create lock surfaces for all outputs on creation of this object to make this possible.
This behavior of the locked event is required in order to prevent possible race conditions with clients that wish to suspend the system or similar after locking the session. Without these semantics, clients triggering a suspend after receiving the locked event would race with the first “locked” frame being presented and normal/unlocked frames might be briefly visible as the system is resumed if the suspend operation wins the race.
If the client dies while the session is locked, the compositor must not unlock the session in response. It is acceptable for the session to be permanently locked if this happens. The compositor may choose to continue to display the lock surfaces the client had mapped before it died or alternatively fall back to a solid color, this is compositor policy.
Compositors may also allow a secure way to recover the session, the details of this are compositor policy. Compositors may allow a new client to create a ext_session_lock_v1 object and take responsibility for unlocking the session, they may even start a new lock client instance automatically.
See also the Request enum for this interface.
Implementations§
source§impl ExtSessionLockV1
impl ExtSessionLockV1
sourcepub fn locked(&self)
pub fn locked(&self)
session successfully locked
This client is now responsible for displaying graphics while the session is locked and deciding when to unlock the session.
The locked event must not be sent until a new “locked” frame has been presented on all outputs and no security sensitive normal/unlocked content is possibly visible.
If this event is sent, making the destroy request is a protocol error, the lock object must be destroyed using the unlock_and_destroy request.
sourcepub fn finished(&self)
pub fn finished(&self)
the session lock object should be destroyed
The compositor has decided that the session lock should be destroyed as it will no longer be used by the compositor. Exactly when this event is sent is compositor policy, but it must never be sent more than once for a given session lock object.
This might be sent because there is already another ext_session_lock_v1 object held by a client, or the compositor has decided to deny the request to lock the session for some other reason. This might also be sent because the compositor implements some alternative, secure way to authenticate and unlock the session.
The finished event should be sent immediately on creation of this object if the compositor decides that the locked event will not be sent.
If the locked event is sent on creation of this object the finished event may still be sent at some later time in this object’s lifetime. This is compositor policy.
Upon receiving this event, the client should make either the destroy request or the unlock_and_destroy request, depending on whether or not the locked event was received on this object.
Trait Implementations§
source§impl Borrow<ObjectId> for ExtSessionLockV1
impl Borrow<ObjectId> for ExtSessionLockV1
source§impl Clone for ExtSessionLockV1
impl Clone for ExtSessionLockV1
source§fn clone(&self) -> ExtSessionLockV1
fn clone(&self) -> ExtSessionLockV1
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ExtSessionLockV1
impl Debug for ExtSessionLockV1
source§impl Hash for ExtSessionLockV1
impl Hash for ExtSessionLockV1
source§impl PartialEq<Weak<ExtSessionLockV1>> for ExtSessionLockV1
impl PartialEq<Weak<ExtSessionLockV1>> for ExtSessionLockV1
source§impl PartialEq for ExtSessionLockV1
impl PartialEq for ExtSessionLockV1
source§impl Resource for ExtSessionLockV1
impl Resource for ExtSessionLockV1
source§fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>
fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>
source§fn handle(&self) -> &WeakHandle
fn handle(&self) -> &WeakHandle
source§fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>
fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>
source§fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>
fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>
source§fn parse_request(
conn: &DisplayHandle,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(Self, Self::Request), DispatchError>
fn parse_request( conn: &DisplayHandle, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Request), DispatchError>
source§fn write_event<'a>(
&self,
conn: &DisplayHandle,
msg: Self::Event<'a>,
) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>
fn write_event<'a>( &self, conn: &DisplayHandle, msg: Self::Event<'a>, ) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>
source§fn is_alive(&self) -> bool
fn is_alive(&self) -> bool
impl Eq for ExtSessionLockV1
Auto Trait Implementations§
impl Freeze for ExtSessionLockV1
impl !RefUnwindSafe for ExtSessionLockV1
impl Send for ExtSessionLockV1
impl Sync for ExtSessionLockV1
impl Unpin for ExtSessionLockV1
impl !UnwindSafe for ExtSessionLockV1
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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.