v0.4.0 b6be3a8

output_events.go RawHistoryFolder

1package ports
2
3import (
4	"image"
5	"time"
6)
7
8// OutputEvent carries output → core notifications.
9type OutputEvent interface{ outputEvent() }
10
11// OutputInfo describes a connected display. Sizes are physical pixels.
12type OutputInfo struct {
13	// Name is the connector (e.g. DP-2), matched against output.<name>.* config.
14	Name string
15	// Make, Model and Serial come from EDID; empty when unknown.
16	Make, Model, Serial  string
17	Width, Height        int
18	RefreshMilli         int
19	PhysicalW, PhysicalH int // millimetres
20}
21
22// Key identifies the monitor across connectors: make, model and serial, or
23// the connector name when EDID has no serial.
24func (i OutputInfo) Key() string {
25	if i.Serial == "" {
26		return i.Name
27	}
28	return i.Make + " " + i.Model + " " + i.Serial
29}
30
31// OutputMode describes a connected connector's physical mode.
32type OutputMode struct {
33	Width, Height, RefreshMilli int
34	Preferred                   bool
35}
36
37// OutputHead describes a connected connector even when it is disabled.
38// Current is the active mode; it is nil for disabled or not-yet-running heads.
39type OutputHead struct {
40	Info    OutputInfo
41	Modes   []OutputMode
42	Current *OutputMode
43	Enabled bool
44}
45
46// OutputHeads is a complete backend inventory, delivered to Wayland after a scan.
47type OutputHeads struct{ Heads []OutputHead }
48
49// HeadChange is the complete desired state of one head in a configuration.
50type HeadChange struct {
51	Name    string
52	Enabled bool
53	Mode    *OutputMode
54	Pos     *image.Point
55	Scale   float64
56	// Transform is nil to leave the transform unchanged.
57	Transform *BufferTransform
58}
59
60// OutputApply asks the app owner to validate or apply a runtime configuration.
61type OutputApply struct {
62	ID    uint64
63	Test  bool
64	Heads []HeadChange
65}
66
67// OutputApplied reports completion (or failure) of a runtime configuration.
68type OutputApplied struct {
69	ID  uint64
70	Err error
71}
72
73// OutputAdded carries output → core a new display, or a new mode for a known
74// connector.
75type OutputAdded struct{ Info OutputInfo }
76
77func (OutputAdded) outputEvent() {}
78
79// OutputPresented carries output → wayland what an output shows and reads.
80// Flip is set when a page flip completed: frame callbacks of the surfaces
81// on it are due. Shown and Queued are the DMABuf IDs scanned out directly
82// (0: a composed image); Seen is the latest content Seq per window the
83// output finished reading (the GPU is done with it). A replaced client
84// buffer is released once every output that reports has seen a later
85// content of its window and neither shows nor queues it.
86type OutputPresented struct {
87	Output        string
88	Flip          *FlipInfo
89	Shown, Queued uint64
90	Seen          map[WindowID]uint64
91	// ChildReads is the oldest content Seq per window still read by a child
92	// renderer on a separate device. Unlike Seen, these holds never time out:
93	// they end only with a completed render or device shutdown.
94	ChildReads map[WindowID]uint64
95}
96
97// OutputFormats carries output → wayland the dmabuf formats an output can
98// scan out directly (its primary plane's, that the renderer also samples,
99// so a refused buffer can still be composed). Device is the KMS device
100// (dev_t) clients allocate scanout buffers for. Sent after every successful
101// modeset, including startup and VT resume; empty Formats means no direct
102// scanout. HDR is non-nil only when the output's HDR10 modeset succeeded;
103// nil means SDR, regardless of the monitor's HDR capability.
104type OutputFormats struct {
105	Output  string
106	Device  uint64
107	Formats []DMABufFormat
108	HDR     *OutputHDR
109}
110
111// OutputHDR carries the active HDR10 output's EDID luminances in nits.
112// These describe the display, not any client's content metadata.
113type OutputHDR struct {
114	MaxLuminance, MaxFrameAverage, MinLuminance float64
115}
116
117// FlipInfo is one completed page flip. When is its CLOCK_MONOTONIC time
118// (hardware clock on DRM), Seq the output's vblank counter, Refresh the
119// refresh period (0 while variable refresh is on). ZeroCopy is the window
120// whose buffer was shown without composition (direct scanout or overlay
121// plane; 0: none), Async set for a tearing flip.
122// Shows is the content Seq per window the flipped frame shows. Merged
123// counts earlier flips folded into this one when the reader fell behind:
124// their presentation feedback is discarded.
125type FlipInfo struct {
126	When          time.Duration
127	Seq           uint64
128	Refresh       time.Duration
129	ZeroCopy      WindowID
130	Async         bool
131	HardwareClock bool
132	Merged        int
133	Shows         map[WindowID]uint64
134}
135
136// OutputFrame carries output → core a completed page flip: the next frame
137// of a running animation is due.
138type OutputFrame struct{ Output string }
139
140// OutputRemoved carries output → core an unplugged display.
141type OutputRemoved struct{ Name string }
142
143func (OutputRemoved) outputEvent() {}
144
145// ConfigChanged carries config → core reloads.
146type ConfigChanged struct{ Config Config }
147
148// ScaleChanged carries core → persistence a scale set by a scale bind.
149type ScaleChanged struct {
150	Output string
151	Scale  float64
152}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 25

Tags 10

↑↓ moveenter openesc close