Documentation
¶
Overview ¶
Package regionoverlay is the region selection overlay: a layer surface on every monitor, a dim wash with a transparent hole where the selection overlaps that monitor, an accent border with resize handles, and a "W × H" size label. A drag draws the selection and a plain click picks the window (else the output) under the pointer; the selection is then moved, resized from its edges and corners or nudged with the arrow keys until Enter or a double-click confirms it. Everything is tracked in global (compositor-layout) logical coordinates, so a selection can span monitors. The screenshot host passes frozen per-output frames, which the surfaces paint behind the wash (freeze-frame) with a magnifier at the pointer; the share picker passes none, so the live screen shows through.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
Overlay is the overlay component. Request is its only entry point; everything else runs on the lys-ui loop goroutine.
func New ¶
func New(a *app.Application, outputs func() []*app.Output, windows func() []image.Rectangle, font render.Font, sheet *widget.Stylesheet) *Overlay
New builds the overlay on the application; outputs lists the monitors to cover at each request, windows (nil for none) the windows a click can pick.
func (*Overlay) Cancel ¶
func (o *Overlay) Cancel()
Cancel answers the open request, if any, as cancelled and takes the surfaces down. Call it from any goroutine but the loop's.
func (*Overlay) Request ¶
Request opens the overlay and blocks until the user confirms a region (ok) or cancels with Escape (not ok). frames maps connector names to frozen frames painted behind the wash; nil or a missing connector leaves that surface transparent over the live screen. A request arriving while one is open cancels the older one. Call it from any goroutine but the loop's.
type Selection ¶
type Selection struct {
// Output is the connector name of the output the selection is
// relative to.
Output string
X, Y, Width, Height int
}
Selection is a region the user dragged, in logical pixels relative to Output: slurp's `<output>@x,y,w,h` and the screencopy region semantics.