Documentation
¶
Overview ¶
Package displays reads and applies the compositor's output layout over wlr-output-management, and arranges outputs on a plane: the logical rectangles the Displays page drags, snaps and normalizes.
Index ¶
- Variables
- func Match(h Head) string
- func ModeText(m Mode) string
- func Rules(existing []any, heads []Head, settings []Setting) []any
- func ScaleValue(s float64) float64
- type Head
- type Manager
- func (m *Manager) Apply(settings []Setting) error
- func (m *Manager) Close()
- func (m *Manager) HandleCallbackDone(wl.CallbackDoneEvent)
- func (m *Manager) HandleRegistryGlobal(ev wl.RegistryGlobalEvent)
- func (m *Manager) HandleRegistryGlobalRemove(wl.RegistryGlobalRemoveEvent)
- func (m *Manager) HandleZwlrOutputManagerV1Done(ev wlr.ZwlrOutputManagerV1DoneEvent)
- func (m *Manager) HandleZwlrOutputManagerV1Finished(wlr.ZwlrOutputManagerV1FinishedEvent)
- func (m *Manager) HandleZwlrOutputManagerV1Head(ev wlr.ZwlrOutputManagerV1HeadEvent)
- func (m *Manager) Test(settings []Setting) error
- type Mode
- type Rect
- type Setting
Constants ¶
This section is empty.
Variables ¶
var ErrNoOutputManagement = errors.New("displays: the compositor offers no " + managerIface)
ErrNoOutputManagement is a compositor without wlr-output-management.
var ErrRefused = errors.New("displays: the compositor refused the layout")
ErrRefused is a configuration the compositor would not take.
var ErrSuperseded = errors.New("displays: the outputs changed before the layout was applied")
ErrSuperseded is a configuration the compositor cancelled because the outputs changed while it was being made.
Functions ¶
func Match ¶
Match is the outputs-rule match that names h: its description when the compositor knows one beyond the connector, so the rule follows the monitor across ports, else its connector.
Types ¶
type Head ¶
type Head struct {
Name, Description string
Make, Model, Serial string
Enabled bool
Modes []Mode
Current int
X, Y int
Scale float64
}
Head is one output as the compositor describes it.
func (Head) CurrentMode ¶
CurrentMode is the head's current mode, false while it has none.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a connection of its own to the compositor that follows its heads. One goroutine reads the connection; requests go out from any goroutine under mu.
func Connect ¶
Connect connects to the compositor named by WAYLAND_DISPLAY; onHeads hears every complete set of heads, the first before Connect returns, on the connection's goroutine.
func (*Manager) Close ¶
func (m *Manager) Close()
Close closes the connection once a final sync comes back.
func (*Manager) HandleCallbackDone ¶
func (m *Manager) HandleCallbackDone(wl.CallbackDoneEvent)
HandleCallbackDone is Close's final sync: the read loop stops.
func (*Manager) HandleRegistryGlobal ¶
func (m *Manager) HandleRegistryGlobal(ev wl.RegistryGlobalEvent)
HandleRegistryGlobal binds the output manager.
func (*Manager) HandleRegistryGlobalRemove ¶
func (m *Manager) HandleRegistryGlobalRemove(wl.RegistryGlobalRemoveEvent)
HandleRegistryGlobalRemove ignores globals going away; a head leaving is the manager's to tell.
func (*Manager) HandleZwlrOutputManagerV1Done ¶
func (m *Manager) HandleZwlrOutputManagerV1Done(ev wlr.ZwlrOutputManagerV1DoneEvent)
HandleZwlrOutputManagerV1Done publishes the heads as they now are.
func (*Manager) HandleZwlrOutputManagerV1Finished ¶
func (m *Manager) HandleZwlrOutputManagerV1Finished(wlr.ZwlrOutputManagerV1FinishedEvent)
HandleZwlrOutputManagerV1Finished drops the manager the compositor let go.
func (*Manager) HandleZwlrOutputManagerV1Head ¶
func (m *Manager) HandleZwlrOutputManagerV1Head(ev wlr.ZwlrOutputManagerV1HeadEvent)
HandleZwlrOutputManagerV1Head follows a new head.
type Rect ¶
type Rect struct{ X, Y, W, H int }
Rect is an output's logical rectangle on the plane.
func Logical ¶
Logical is the rectangle an enabled setting covers: its mode in logical pixels at its position.
func NextEdge ¶
NextEdge is the nearest position past rects[i] along one axis, in the direction of the sign of dx or dy, at which one of its edges meets an edge of another rectangle; false when there is none.