Documentation
¶
Overview ¶
Package display reads and changes the target monitor through the operating system: its modes, its gamma table and whether it is lit. display_darwin.go and display_windows.go implement Target and the Monitor methods.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrGammaLimited = errors.New("display: the system limited the dimming")
ErrGammaLimited means the system refused the requested dimming and a milder one was applied: Windows keeps gamma ramps near the identity.
Functions ¶
Types ¶
type Mode ¶
type Mode struct {
Width, Height int // the size the desktop uses (points on macOS)
PixelWidth, PixelHeight int // the size drawn
RefreshRate int
// contains filtered or unexported fields
}
Mode is a resolution and refresh rate the monitor can show.
func RefreshRates ¶
RefreshRates returns the modes of the resolution of current, fastest first.
func Resolutions ¶
Resolutions returns one mode per resolution, HiDPI or not, preferring the given refresh rate, from the largest.
type Monitor ¶
type Monitor struct {
Name string // e.g. "Mi Monitor"
Connection string // e.g. "HDMI", or "" when unknown
// Native is the panel's own resolution where the system tells it
// (Windows, from the EDID), zero otherwise.
NativeWidth, NativeHeight int
// contains filtered or unexported fields
}
Monitor is the external display the app manages.
func (Monitor) NativeSize ¶
NativeSize is the monitor's own resolution: what the system reports, or the largest mode drawn 1:1, as HiDPI modes draw more pixels than the panel has. A reported size smaller than the current mode is not trusted (virtual displays of remote desktops report one): the current mode wins.