pointerconstraints

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ConfinedPointerInterface = "zwp_confined_pointer_v1"

ConfinedPointerInterface is the protocol interface name.

View Source
const ERROR_ALREADY_CONSTRAINED = 1

ERROR_ALREADY_CONSTRAINED is the error already_constrained value.

View Source
const LIFETIME_ONESHOT = 1

LIFETIME_ONESHOT is the lifetime oneshot value.

View Source
const LIFETIME_PERSISTENT = 2

LIFETIME_PERSISTENT is the lifetime persistent value.

View Source
const LockedPointerInterface = "zwp_locked_pointer_v1"

LockedPointerInterface is the protocol interface name.

View Source
const PointerConstraintsInterface = "zwp_pointer_constraints_v1"

PointerConstraintsInterface is the protocol interface name.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfinedPointer

type ConfinedPointer struct {
	wl.BaseProxy
	// contains filtered or unexported fields
}

ConfinedPointer is the generated binding for zwp_confined_pointer_v1 version 1.

func NewConfinedPointer

func NewConfinedPointer(ctx *wl.Context) *ConfinedPointer

NewConfinedPointer returns an unbound ConfinedPointer.

func (*ConfinedPointer) Destroy

func (o *ConfinedPointer) Destroy() error

Destroy the confined pointer object. If applicable, the compositor will unconfine the pointer.

func (*ConfinedPointer) Dispatch

func (o *ConfinedPointer) Dispatch(event *wl.Event)

Dispatch decodes one event on zwp_confined_pointer_v1 and calls the registered handlers.

func (*ConfinedPointer) EventSignature

func (o *ConfinedPointer) EventSignature(opcode uint16) (string, bool)

EventSignature returns the declared event argument types in wire order.

func (*ConfinedPointer) OnConfined

func (o *ConfinedPointer) OnConfined(handler func())

OnConfined registers a handler for the confined event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*ConfinedPointer) OnUnconfined

func (o *ConfinedPointer) OnUnconfined(handler func())

OnUnconfined registers a handler for the unconfined event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*ConfinedPointer) SetRegion

func (o *ConfinedPointer) SetRegion(region *cross_wl_region.Region) error

Set a new region used to confine the pointer. The new confine region is double-buffered, see wl_surface.commit. If the confinement is active when the new confinement region is applied and the pointer ends up outside of newly applied region, the pointer may warped to a position within the new confinement region. If warped, a wl_pointer.motion event will be emitted, but no wp_relative_pointer.relative_motion event. The compositor may also, instead of using the new region, unconfine the pointer. For details about the confine region, see wp_confined_pointer.

type LockedPointer

type LockedPointer struct {
	wl.BaseProxy
	// contains filtered or unexported fields
}

LockedPointer is the generated binding for zwp_locked_pointer_v1 version 1.

func NewLockedPointer

func NewLockedPointer(ctx *wl.Context) *LockedPointer

NewLockedPointer returns an unbound LockedPointer.

func (*LockedPointer) Destroy

func (o *LockedPointer) Destroy() error

Destroy the locked pointer object. If applicable, the compositor will unlock the pointer.

func (*LockedPointer) Dispatch

func (o *LockedPointer) Dispatch(event *wl.Event)

Dispatch decodes one event on zwp_locked_pointer_v1 and calls the registered handlers.

func (*LockedPointer) EventSignature

func (o *LockedPointer) EventSignature(opcode uint16) (string, bool)

EventSignature returns the declared event argument types in wire order.

func (*LockedPointer) OnLocked

func (o *LockedPointer) OnLocked(handler func())

OnLocked registers a handler for the locked event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*LockedPointer) OnUnlocked

func (o *LockedPointer) OnUnlocked(handler func())

OnUnlocked registers a handler for the unlocked event.

Handlers are appended, so a second call adds another handler rather than replacing the first. Registration is safe while another goroutine dispatches.

func (*LockedPointer) SetCursorPositionHint

func (o *LockedPointer) SetCursorPositionHint(surfaceX wl.Fixed, surfaceY wl.Fixed) error

Set the cursor position hint relative to the top left corner of the surface. If the client is drawing its own cursor, it should update the position hint to the position of its own cursor. A compositor may use this information to warp the pointer upon unlock in order to avoid pointer jumps. The cursor position hint is double-buffered state, see wl_surface.commit.

func (*LockedPointer) SetRegion

func (o *LockedPointer) SetRegion(region *cross_wl_region.Region) error

Set a new region used to lock the pointer. The new lock region is double-buffered, see wl_surface.commit. For details about the lock region, see wp_locked_pointer.

type PointerConstraints

type PointerConstraints struct {
	wl.BaseProxy
}

PointerConstraints is the generated binding for zwp_pointer_constraints_v1 version 1.

func NewPointerConstraints

func NewPointerConstraints(ctx *wl.Context) *PointerConstraints

NewPointerConstraints returns an unbound PointerConstraints.

func (*PointerConstraints) ConfinePointer

func (o *PointerConstraints) ConfinePointer(surface *cross_wl_surface.Surface, pointer *cross_wl_pointer.Pointer, region *cross_wl_region.Region, lifetime uint32) (*ConfinedPointer, error)

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.

func (*PointerConstraints) Destroy

func (o *PointerConstraints) Destroy() error

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

func (*PointerConstraints) Dispatch

func (o *PointerConstraints) Dispatch(event *wl.Event)

Dispatch decodes one event on zwp_pointer_constraints_v1 and calls the registered handlers.

func (*PointerConstraints) EventSignature

func (o *PointerConstraints) EventSignature(opcode uint16) (string, bool)

EventSignature returns the declared event argument types in wire order.

func (*PointerConstraints) LockPointer

func (o *PointerConstraints) LockPointer(surface *cross_wl_surface.Surface, pointer *cross_wl_pointer.Pointer, region *cross_wl_region.Region, lifetime uint32) (*LockedPointer, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL