layershell

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ANCHOR_BOTTOM = 2

ANCHOR_BOTTOM is the anchor bottom value.

View Source
const ANCHOR_LEFT = 4

ANCHOR_LEFT is the anchor left value.

View Source
const ANCHOR_RIGHT = 8

ANCHOR_RIGHT is the anchor right value.

View Source
const ANCHOR_TOP = 1

ANCHOR_TOP is the anchor top value.

View Source
const ERROR_ALREADY_CONSTRUCTED = 2

ERROR_ALREADY_CONSTRUCTED is the error already_constructed value.

View Source
const ERROR_INVALID_ANCHOR = 2

ERROR_INVALID_ANCHOR is the error invalid_anchor value.

View Source
const ERROR_INVALID_EXCLUSIVE_EDGE = 4

ERROR_INVALID_EXCLUSIVE_EDGE is the error invalid_exclusive_edge value.

View Source
const ERROR_INVALID_KEYBOARD_INTERACTIVITY = 3

ERROR_INVALID_KEYBOARD_INTERACTIVITY is the error invalid_keyboard_interactivity value.

View Source
const ERROR_INVALID_LAYER = 1

ERROR_INVALID_LAYER is the error invalid_layer value.

View Source
const ERROR_INVALID_SIZE = 1

ERROR_INVALID_SIZE is the error invalid_size value.

View Source
const ERROR_INVALID_SURFACE_STATE = 0

ERROR_INVALID_SURFACE_STATE is the error invalid_surface_state value.

View Source
const ERROR_ROLE = 0

ERROR_ROLE is the error role value.

View Source
const KEYBOARD_INTERACTIVITY_EXCLUSIVE = 1

KEYBOARD_INTERACTIVITY_EXCLUSIVE is the keyboard_interactivity exclusive value.

View Source
const KEYBOARD_INTERACTIVITY_NONE = 0

KEYBOARD_INTERACTIVITY_NONE is the keyboard_interactivity none value.

View Source
const KEYBOARD_INTERACTIVITY_ON_DEMAND = 2

KEYBOARD_INTERACTIVITY_ON_DEMAND is the keyboard_interactivity on_demand value.

View Source
const LAYER_BACKGROUND = 0

LAYER_BACKGROUND is the layer background value.

View Source
const LAYER_BOTTOM = 1

LAYER_BOTTOM is the layer bottom value.

View Source
const LAYER_OVERLAY = 3

LAYER_OVERLAY is the layer overlay value.

View Source
const LAYER_TOP = 2

LAYER_TOP is the layer top value.

View Source
const LayerShellInterface = "zwlr_layer_shell_v1"

LayerShellInterface is the protocol interface name.

View Source
const LayerSurfaceInterface = "zwlr_layer_surface_v1"

LayerSurfaceInterface is the protocol interface name.

Variables

This section is empty.

Functions

This section is empty.

Types

type LayerShell

type LayerShell struct {
	wl.BaseProxy
}

LayerShell is the generated binding for zwlr_layer_shell_v1 version 5.

func NewLayerShell

func NewLayerShell(ctx *wl.Context) *LayerShell

NewLayerShell returns an unbound LayerShell.

func (*LayerShell) Destroy

func (o *LayerShell) Destroy() error

This request indicates that the client will not use the layer_shell object any more. Objects that have been created through this instance are not affected.

func (*LayerShell) Dispatch

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

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

func (*LayerShell) EventSignature

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

EventSignature returns the declared event argument types in wire order.

func (*LayerShell) GetLayerSurface

func (o *LayerShell) GetLayerSurface(surface *cross_wl_surface.Surface, output *cross_wl_output.Output, layer uint32, namespace string) (*LayerSurface, error)

Create a layer surface for an existing surface. This assigns the role of layer_surface, or raises a protocol error if another role is already assigned. Creating a layer surface from a wl_surface which has a buffer attached or committed is a client error, and any attempts by a client to attach or manipulate a buffer prior to the first layer_surface.configure call must also be treated as errors. After creating a layer_surface object and setting it up, the client must perform an initial commit without any buffer attached. The compositor will reply with a layer_surface.configure event. The client must acknowledge it and is then allowed to attach a buffer to map the surface. You may pass NULL for output to allow the compositor to decide which output to use. Generally this will be the one that the user most recently interacted with. Clients can specify a namespace that defines the purpose of the layer surface.

type LayerSurface

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

LayerSurface is the generated binding for zwlr_layer_surface_v1 version 5.

func NewLayerSurface

func NewLayerSurface(ctx *wl.Context) *LayerSurface

NewLayerSurface returns an unbound LayerSurface.

func (*LayerSurface) AckConfigure

func (o *LayerSurface) AckConfigure(serial uint32) error

When a configure event is received, if a client commits the surface in response to the configure event, then the client must make an ack_configure request sometime before the commit request, passing along the serial of the configure event. If the client receives multiple configure events before it can respond to one, it only has to ack the last configure event. A client is not required to commit immediately after sending an ack_configure request - it may even ack_configure several times before its next surface commit. A client may send multiple ack_configure requests before committing, but only the last request sent before a commit indicates which configure event the client really is responding to.

func (*LayerSurface) Destroy

func (o *LayerSurface) Destroy() error

This request destroys the layer surface.

func (*LayerSurface) Dispatch

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

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

func (*LayerSurface) EventSignature

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

EventSignature returns the declared event argument types in wire order.

func (*LayerSurface) GetPopup

func (o *LayerSurface) GetPopup(popup *cross_xdg_popup.XdgPopup) error

This assigns an xdg_popup's parent to this layer_surface. This popup should have been created via xdg_surface::get_popup with the parent set to NULL, and this request must be invoked before committing the popup's initial state. See the documentation of xdg_popup for more details about what an xdg_popup is and how it is used.

func (*LayerSurface) OnClosed

func (o *LayerSurface) OnClosed(handler func())

OnClosed registers a handler for the closed event.

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

func (*LayerSurface) OnConfigure

func (o *LayerSurface) OnConfigure(handler func(serial uint32, width uint32, height uint32))

OnConfigure registers a handler for the configure event.

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

func (*LayerSurface) SetAnchor

func (o *LayerSurface) SetAnchor(anchor uint32) error

Requests that the compositor anchor the surface to the specified edges and corners. If two orthogonal edges are specified (e.g. 'top' and 'left'), then the anchor point will be the intersection of the edges (e.g. the top left corner of the output); otherwise the anchor point will be centered on that edge, or in the center if none is specified. Anchor is double-buffered, see wl_surface.commit.

func (*LayerSurface) SetExclusiveEdge

func (o *LayerSurface) SetExclusiveEdge(edge uint32) error

Requests an edge for the exclusive zone to apply. The exclusive edge will be automatically deduced from anchor points when possible, but when the surface is anchored to a corner, it will be necessary to set it explicitly to disambiguate, as it is not possible to deduce which one of the two corner edges should be used. The edge must be one the surface is anchored to, otherwise the invalid_exclusive_edge protocol error will be raised.

func (*LayerSurface) SetExclusiveZone

func (o *LayerSurface) SetExclusiveZone(zone int32) error

Requests that the compositor avoids occluding an area with other surfaces. The compositor's use of this information is implementation-dependent - do not assume that this region will not actually be occluded. A positive value is only meaningful if the surface is anchored to one edge or an edge and both perpendicular edges. If the surface is not anchored, anchored to only two perpendicular edges (a corner), anchored to only two parallel edges or anchored to all edges, a positive value will be treated the same as zero. A positive zone is the distance from the edge in surface-local coordinates to consider exclusive. Surfaces that do not wish to have an exclusive zone may instead specify how they should interact with surfaces that do. If set to zero, the surface indicates that it would like to be moved to avoid occluding surfaces with a positive exclusive zone. If set to -1, the surface indicates that it would not like to be moved to accommodate for other surfaces, and the compositor should extend it all the way to the edges it is anchored to. For example, a panel might set its exclusive zone to 10, so that maximized shell surfaces are not shown on top of it. A notification might set its exclusive zone to 0, so that it is moved to avoid occluding the panel, but shell surfaces are shown underneath it. A wallpaper or lock screen might set their exclusive zone to -1, so that they stretch below or over the panel. The default value is 0. Exclusive zone is double-buffered, see wl_surface.commit.

func (*LayerSurface) SetKeyboardInteractivity

func (o *LayerSurface) SetKeyboardInteractivity(keyboardInteractivity uint32) error

Set how keyboard events are delivered to this surface. By default, layer shell surfaces do not receive keyboard events; this request can be used to change this. This setting is inherited by child surfaces set by the get_popup request. Layer surfaces receive pointer, touch, and tablet events normally. If you do not want to receive them, set the input region on your surface to an empty region. Keyboard interactivity is double-buffered, see wl_surface.commit.

func (*LayerSurface) SetLayer

func (o *LayerSurface) SetLayer(layer uint32) error

Change the layer that the surface is rendered on. Layer is double-buffered, see wl_surface.commit.

func (*LayerSurface) SetMargin

func (o *LayerSurface) SetMargin(top int32, right int32, bottom int32, left int32) error

Requests that the surface be placed some distance away from the anchor point on the output, in surface-local coordinates. Setting this value for edges you are not anchored to has no effect. The exclusive zone includes the margin. Margin is double-buffered, see wl_surface.commit.

func (*LayerSurface) SetSize

func (o *LayerSurface) SetSize(width uint32, height uint32) error

Sets the size of the surface in surface-local coordinates. The compositor will display the surface centered with respect to its anchors. If you pass 0 for either value, the compositor will assign it and inform you of the assignment in the configure event. You must set your anchor to opposite edges in the dimensions you omit; not doing so is a protocol error. Both values are 0 by default. Size is double-buffered, see wl_surface.commit.

Jump to

Keyboard shortcuts

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