pub struct PointerConstraintsState {
    pointer_constraints: ZwpPointerConstraintsV1,
}

Fields§

§pointer_constraints: ZwpPointerConstraintsV1

Implementations§

source§

impl PointerConstraintsState

source

pub fn new( globals: &GlobalList, queue_handle: &QueueHandle<WinitState>, ) -> Result<Self, BindError>

Methods from Deref<Target = ZwpPointerConstraintsV1>§

source

pub fn destroy(&self)

destroy the pointer constraints manager object

Used by the client to notify the server that it will no longer use this pointer constraints object.

source

pub fn lock_pointer<U, D>( &self, surface: &WlSurface, pointer: &WlPointer, region: Option<&WlRegion>, lifetime: Lifetime, qh: &QueueHandle<D>, udata: U, ) -> ZwpLockedPointerV1
where U: Send + Sync + 'static, D: Dispatch<ZwpLockedPointerV1, U> + 'static,

lock pointer to a position

The lock_pointer request lets the client request to disable movements of the virtual pointer (i.e. the cursor), effectively locking the pointer to a position. This request may not take effect immediately; in the future, when the compositor deems implementation-specific constraints are satisfied, the pointer lock will be activated and the compositor sends a locked event.

The protocol provides no guarantee that the constraints are ever satisfied, and does not require the compositor to send an error if the constraints cannot ever be satisfied. It is thus possible to request a lock that will never activate.

There may not be another pointer constraint of any kind requested or active on the surface for any of the wl_pointer objects of the seat of the passed pointer when requesting a lock. If there is, an error will be raised. See general pointer lock documentation for more details.

The intersection of the region passed with this request and the input region of the surface is used to determine where the pointer must be in order for the lock to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the lock to activate. If the region is null the surface input region is used.

A surface may receive pointer focus without the lock being activated.

The request creates a new object wp_locked_pointer which is used to interact with the lock as well as receive updates about its state. See the the description of wp_locked_pointer for further information.

Note that while a pointer is locked, the wl_pointer objects of the corresponding seat will not emit any wl_pointer.motion events, but relative motion events will still be emitted via wp_relative_pointer objects of the same seat. wl_pointer.axis and wl_pointer.button events are unaffected.

source

pub fn confine_pointer<U, D>( &self, surface: &WlSurface, pointer: &WlPointer, region: Option<&WlRegion>, lifetime: Lifetime, qh: &QueueHandle<D>, udata: U, ) -> ZwpConfinedPointerV1
where U: Send + Sync + 'static, D: Dispatch<ZwpConfinedPointerV1, U> + 'static,

confine pointer to a region

The confine_pointer request lets the client request to confine the pointer cursor to a given region. This request may not take effect immediately; in the future, when the compositor deems implementation- specific constraints are satisfied, the pointer confinement will be activated and the compositor sends a confined event.

The intersection of the region passed with this request and the input region of the surface is used to determine where the pointer must be in order for the confinement to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the confinement to activate. If the region is null the surface input region is used.

The request will create a new object wp_confined_pointer which is used to interact with the confinement as well as receive updates about its state. See the the description of wp_confined_pointer for further information.

Trait Implementations§

source§

impl Deref for PointerConstraintsState

§

type Target = ZwpPointerConstraintsV1

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Dispatch<ZwpConfinedPointerV1, GlobalData, WinitState> for PointerConstraintsState

source§

fn event( _state: &mut WinitState, _proxy: &ZwpConfinedPointerV1, _event: <ZwpConfinedPointerV1 as Proxy>::Event, _data: &GlobalData, _conn: &Connection, _qhandle: &QueueHandle<WinitState>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<ZwpLockedPointerV1, GlobalData, WinitState> for PointerConstraintsState

source§

fn event( _state: &mut WinitState, _proxy: &ZwpLockedPointerV1, _event: <ZwpLockedPointerV1 as Proxy>::Event, _data: &GlobalData, _conn: &Connection, _qhandle: &QueueHandle<WinitState>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl Dispatch<ZwpPointerConstraintsV1, GlobalData, WinitState> for PointerConstraintsState

source§

fn event( _state: &mut WinitState, _proxy: &ZwpPointerConstraintsV1, _event: <ZwpPointerConstraintsV1 as Proxy>::Event, _data: &GlobalData, _conn: &Connection, _qhandle: &QueueHandle<WinitState>, )

Called when an event from the server is processed Read more
source§

fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events 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 + Sync + Send>

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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

impl<T> WithSubscriber for T

source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more