shell

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT, MIT Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package shell implements xdg-shell: the window roles clients request and the configure handshake the window manager drives.

Index

Constants

View Source
const (
	PingTimeout = 5 * time.Second
)

Variables

View Source
var IconSizes = []int32{16, 32, 64}

Functions

func NewHandle

func NewHandle() (string, error)

Types

type Activate

type Activate struct {
	Token string
}

type Anchor

type Anchor = sxdg.XdgPositionerAnchor

type Change

type Change uint8
const (
	ChangedTitle Change = iota + 1
	ChangedAppID
	ChangedParent
	ChangedModal
	ChangedIcon
	ChangedSizeLimits
	ChangedTag
	ChangedDecoration
)

type Gravity

type Gravity = sxdg.XdgPositionerGravity

type Icon

type Icon struct {
	Serial uint64
	Name   string
	Images []IconImage
}

func (*Icon) Best

func (i *Icon) Best(px int) (IconImage, bool)

type IconImage

type IconImage struct {
	Scale int
	Image *image.RGBA
}

func (IconImage) Pixels

func (i IconImage) Pixels() int

type Layer

type LayerState

type LayerState struct {
	Layer         Layer
	Size          image.Point
	Anchor        Edges
	ExclusiveZone int
	ExclusiveEdge Edges
	Margin        Margin
	Interactivity Interactivity
}

type LayerSurface

type LayerSurface struct {
	// contains filtered or unexported fields
}

func (*LayerSurface) AckConfigure

func (l *LayerSurface) AckConfigure(obj *swlr.ZwlrLayerSurfaceV1, serial uint32) error

func (*LayerSurface) Applied

func (l *LayerSurface) Applied() image.Point

func (*LayerSurface) Close

func (l *LayerSurface) Close() error

func (*LayerSurface) Committed

func (l *LayerSurface) Committed(s *surface.Surface) error

func (*LayerSurface) Configure

func (l *LayerSurface) Configure(size image.Point) error

func (*LayerSurface) Current

func (l *LayerSurface) Current() LayerState

func (*LayerSurface) Destroy

func (*LayerSurface) GetPopup

func (l *LayerSurface) GetPopup(_ *swlr.ZwlrLayerSurfaceV1, res *sxdg.XdgPopup) error

func (*LayerSurface) HandoverPrelude

func (l *LayerSurface) HandoverPrelude(st *server.Stream, res *sw.WlSurface) (bool, error)

func (*LayerSurface) Live

func (l *LayerSurface) Live() bool

func (*LayerSurface) Mapped

func (l *LayerSurface) Mapped() bool

func (*LayerSurface) Namespace

func (l *LayerSurface) Namespace() string

func (*LayerSurface) Output

func (l *LayerSurface) Output() *sw.WlOutput

func (*LayerSurface) Placement

func (*LayerSurface) Placement() image.Rectangle

func (*LayerSurface) Popups

func (l *LayerSurface) Popups() []*Popup

func (*LayerSurface) RoleName

func (l *LayerSurface) RoleName() string

func (*LayerSurface) SetAnchor

func (l *LayerSurface) SetAnchor(obj *swlr.ZwlrLayerSurfaceV1, anchor Edges) error

func (*LayerSurface) SetExclusiveEdge

func (l *LayerSurface) SetExclusiveEdge(obj *swlr.ZwlrLayerSurfaceV1, edge Edges) error

func (*LayerSurface) SetExclusiveZone

func (l *LayerSurface) SetExclusiveZone(_ *swlr.ZwlrLayerSurfaceV1, zone int32) error

func (*LayerSurface) SetKeyboardInteractivity

func (l *LayerSurface) SetKeyboardInteractivity(obj *swlr.ZwlrLayerSurfaceV1, k Interactivity) error

func (*LayerSurface) SetLayer

func (l *LayerSurface) SetLayer(_ *swlr.ZwlrLayerSurfaceV1, layer Layer) error

func (*LayerSurface) SetMargin

func (l *LayerSurface) SetMargin(_ *swlr.ZwlrLayerSurfaceV1, top, right, bottom, left int32) error

func (*LayerSurface) SetSize

func (l *LayerSurface) SetSize(_ *swlr.ZwlrLayerSurfaceV1, w, h uint32) error

func (*LayerSurface) Surface

func (l *LayerSurface) Surface() *surface.Surface

type Listener

type Listener interface {
	ToplevelInitialCommit(t *Toplevel) error
	ToplevelMapped(t *Toplevel) error
	ToplevelUnmapped(t *Toplevel) error
	ToplevelChanged(t *Toplevel, c Change) error
	ToplevelRequest(t *Toplevel, r Request) error
	ClientResponsive(c *server.Client, responsive bool) error
	PopupConstraint(root PopupRoot) image.Rectangle
	LayerCommitted(l *LayerSurface) error
	LayerUnmapped(l *LayerSurface) error
	LayerDestroyed(l *LayerSurface) error
	PopupMapped(p *Popup) error
	PopupUnmapped(p *Popup) error
	UserActive(c *server.Client, serial uint32) bool
	MintActivationToken(c *server.Client, serial uint32) (string, error)
	GrabChanged() error
	LockChanged() error
	LockReleasing() error
	LockOutputSize(output *sw.WlOutput) (image.Point, bool)
}

type LockSurface

type LockSurface struct {
	// contains filtered or unexported fields
}

func (*LockSurface) AckConfigure

func (s *LockSurface) AckConfigure(obj *sel.ExtSessionLockSurfaceV1, serial uint32) error

func (*LockSurface) Committed

func (s *LockSurface) Committed(sf *surface.Surface) error

func (*LockSurface) Destroy

func (*LockSurface) Output

func (s *LockSurface) Output() *sw.WlOutput

func (*LockSurface) Placement

func (*LockSurface) Placement() image.Rectangle

func (*LockSurface) RoleName

func (*LockSurface) RoleName() string

func (*LockSurface) Surface

func (s *LockSurface) Surface() *surface.Surface

type Margin

type Margin struct {
	Top, Right, Bottom, Left int
}

type Move

type Move struct{ Serial uint32 }
type Popup struct {
	// contains filtered or unexported fields
}

func (*Popup) Box

func (p *Popup) Box() image.Rectangle

func (*Popup) Destroy

func (p *Popup) Destroy(*sxdg.XdgPopup) error

func (*Popup) Geometry

func (p *Popup) Geometry() image.Rectangle

func (*Popup) Grab

func (p *Popup) Grab(obj *sxdg.XdgPopup, _ *sw.WlSeat, serial uint32) error

func (*Popup) Mapped

func (p *Popup) Mapped() bool

func (*Popup) Popups

func (p *Popup) Popups() []*Popup

func (*Popup) Reconstrain

func (p *Popup) Reconstrain() error

func (*Popup) Reposition

func (p *Popup) Reposition(_ *sxdg.XdgPopup, pos *sxdg.XdgPositioner, token uint32) error

func (*Popup) Root

func (p *Popup) Root() PopupRoot

func (*Popup) Surface

func (p *Popup) Surface() *surface.Surface

type PopupRoot

type PopupRoot interface {
	Popups() []*Popup
	Surface() *surface.Surface
}

type Positioner

type Positioner struct {
	Size       image.Point
	AnchorRect image.Rectangle
	Anchor     Anchor
	Gravity    Gravity
	Adjustment Adjustment
	Offset     image.Point
	Reactive   bool
}

func (Positioner) Place

func (p Positioner) Place(bounds image.Rectangle) image.Rectangle

type Request

type Request interface {
	// contains filtered or unexported methods
}

type Resize

type Resize struct {
	Serial uint32
	Edges  sxdg.XdgToplevelResizeEdge
}

type SessionLock

type SessionLock struct {
	// contains filtered or unexported fields
}

func (*SessionLock) Destroy

func (l *SessionLock) Destroy(obj *sel.ExtSessionLockV1) error

func (*SessionLock) GetLockSurface

func (*SessionLock) UnlockAndDestroy

func (l *SessionLock) UnlockAndDestroy(obj *sel.ExtSessionLockV1) error

type SetFullscreen

type SetFullscreen struct{ On bool }

type SetMaximized

type SetMaximized struct{ On bool }

type SetMinimized

type SetMinimized struct{}

type Shell

type Shell struct {
	// contains filtered or unexported fields
}

func New

func New(d *server.Display, l *loop.Loop, listener Listener) (*Shell, error)

func (*Shell) ConfirmLock

func (sh *Shell) ConfirmLock() error

func (*Shell) DismissGrab

func (sh *Shell) DismissGrab() error

func (*Shell) Grab

func (sh *Shell) Grab() []*Popup

func (*Shell) LockAlive

func (sh *Shell) LockAlive() bool

func (*Shell) LockConfirmed

func (sh *Shell) LockConfirmed() bool

func (*Shell) LockSurfaces

func (sh *Shell) LockSurfaces() []*LockSurface

func (*Shell) Locked

func (sh *Shell) Locked() bool

func (*Shell) ReconfigureLock

func (sh *Shell) ReconfigureLock() error

type ShowWindowMenu

type ShowWindowMenu struct {
	Serial uint32
	At     image.Point
}

type State

type State struct {
	Size   image.Point
	Bounds image.Point
	States []ToplevelState
}

func (State) Has

func (s State) Has(st ToplevelState) bool

type Toplevel

type Toplevel struct {
	// contains filtered or unexported fields
}

func (*Toplevel) Acked

func (t *Toplevel) Acked(serial uint32) bool

func (*Toplevel) AppID

func (t *Toplevel) AppID() string

func (*Toplevel) Configure

func (t *Toplevel) Configure(s State) (uint32, error)

func (*Toplevel) Current

func (t *Toplevel) Current() State

func (*Toplevel) Description

func (t *Toplevel) Description() string

func (*Toplevel) Destroy

func (t *Toplevel) Destroy(*sxdg.XdgToplevel) error

func (*Toplevel) Dialog

func (t *Toplevel) Dialog() bool

func (*Toplevel) Geometry

func (t *Toplevel) Geometry() image.Rectangle

func (*Toplevel) ID

func (t *Toplevel) ID() uint32

func (*Toplevel) Icon

func (t *Toplevel) Icon() *Icon

func (*Toplevel) LatestSerial

func (t *Toplevel) LatestSerial() uint32

func (*Toplevel) Mapped

func (t *Toplevel) Mapped() bool

func (*Toplevel) MaxSize

func (t *Toplevel) MaxSize() image.Point

func (*Toplevel) MinSize

func (t *Toplevel) MinSize() image.Point

func (*Toplevel) Modal

func (t *Toplevel) Modal() bool

func (*Toplevel) Move

func (t *Toplevel) Move(_ *sxdg.XdgToplevel, _ *sw.WlSeat, serial uint32) error

func (*Toplevel) Parent

func (t *Toplevel) Parent() *Toplevel

func (*Toplevel) Ping

func (t *Toplevel) Ping() error

func (*Toplevel) Popups

func (t *Toplevel) Popups() []*Popup

func (*Toplevel) Requested

func (t *Toplevel) Requested() State

func (*Toplevel) Resize

func (t *Toplevel) Resize(obj *sxdg.XdgToplevel, _ *sw.WlSeat, serial uint32, edges sxdg.XdgToplevelResizeEdge) error

func (*Toplevel) SendClose

func (t *Toplevel) SendClose() error

func (*Toplevel) ServerDecorated

func (t *Toplevel) ServerDecorated() bool

func (*Toplevel) SetAppID

func (t *Toplevel) SetAppID(_ *sxdg.XdgToplevel, appID string) error

func (*Toplevel) SetFullscreen

func (t *Toplevel) SetFullscreen(*sxdg.XdgToplevel, *sw.WlOutput) error

func (*Toplevel) SetMaxSize

func (t *Toplevel) SetMaxSize(obj *sxdg.XdgToplevel, w, h int32) error

func (*Toplevel) SetMaximized

func (t *Toplevel) SetMaximized(*sxdg.XdgToplevel) error

func (*Toplevel) SetMinSize

func (t *Toplevel) SetMinSize(obj *sxdg.XdgToplevel, w, h int32) error

func (*Toplevel) SetMinimized

func (t *Toplevel) SetMinimized(*sxdg.XdgToplevel) error

func (*Toplevel) SetParent

func (t *Toplevel) SetParent(obj *sxdg.XdgToplevel, parent *sxdg.XdgToplevel) error

func (*Toplevel) SetTitle

func (t *Toplevel) SetTitle(_ *sxdg.XdgToplevel, title string) error

func (*Toplevel) ShowWindowMenu

func (t *Toplevel) ShowWindowMenu(_ *sxdg.XdgToplevel, _ *sw.WlSeat, serial uint32, x, y int32) error

func (*Toplevel) Surface

func (t *Toplevel) Surface() *surface.Surface

func (*Toplevel) Tag

func (t *Toplevel) Tag() string

func (*Toplevel) Title

func (t *Toplevel) Title() string

func (*Toplevel) UnsetFullscreen

func (t *Toplevel) UnsetFullscreen(*sxdg.XdgToplevel) error

func (*Toplevel) UnsetMaximized

func (t *Toplevel) UnsetMaximized(*sxdg.XdgToplevel) error

func (*Toplevel) WantsFullscreen

func (t *Toplevel) WantsFullscreen() bool

func (*Toplevel) WantsMaximized

func (t *Toplevel) WantsMaximized() bool

type ToplevelState

type ToplevelState = sxdg.XdgToplevelState

type XdgSurface

type XdgSurface struct {
	// contains filtered or unexported fields
}

func (*XdgSurface) AckConfigure

func (xs *XdgSurface) AckConfigure(obj *sxdg.XdgSurface, serial uint32) error

func (*XdgSurface) Committed

func (xs *XdgSurface) Committed(s *surface.Surface) error

func (*XdgSurface) Destroy

func (xs *XdgSurface) Destroy(obj *sxdg.XdgSurface) error

func (*XdgSurface) Geometry

func (xs *XdgSurface) Geometry() image.Rectangle

func (*XdgSurface) GetPopup

func (xs *XdgSurface) GetPopup(obj *sxdg.XdgSurface, res *sxdg.XdgPopup, parent *sxdg.XdgSurface, pos *sxdg.XdgPositioner) (sxdg.XdgPopupHandler, error)

func (*XdgSurface) GetToplevel

func (xs *XdgSurface) GetToplevel(obj *sxdg.XdgSurface, res *sxdg.XdgToplevel) (sxdg.XdgToplevelHandler, error)

func (*XdgSurface) HandoverPrelude

func (xs *XdgSurface) HandoverPrelude(st *server.Stream, res *sw.WlSurface) (bool, error)

func (*XdgSurface) Placement

func (xs *XdgSurface) Placement() image.Rectangle

func (*XdgSurface) Popups

func (l *XdgSurface) Popups() []*Popup

func (*XdgSurface) RoleName

func (xs *XdgSurface) RoleName() string

func (*XdgSurface) SetWindowGeometry

func (xs *XdgSurface) SetWindowGeometry(obj *sxdg.XdgSurface, x, y, w, h int32) error

Jump to

Keyboard shortcuts

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