Package xinerama

import ""

Overview ▾

Package xinerama provides a convenience function to retrieve the geometry of all active heads sorted in order from left to right and then top to bottom. While Xinerama is an old extension that isn't often used in lieu of RandR and TwinView, it can still be used to query for information about all active heads. That is, even if TwinView or RandR is being used, Xinerama will still report the correct geometry of each head.

type Heads

type Heads []xrect.Rect

Alias so we use it as a receiver to satisfy sort.Interface

func PhysicalHeads

func PhysicalHeads(xu *xgbutil.XUtil) (Heads, error)

PhyiscalHeads returns the list of heads in a physical ordering. Namely, left to right then top to bottom. (Defined by (X, Y).) Xinerama must have been initialized, otherwise the xinerama.QueryScreens request will panic. PhysicalHeads also checks to make sure each rectangle has a unique (x, y) tuple, so as not to return the geometry of cloned displays. (At present moment, xgbutil initializes Xinerama automatically during initial connection.)

func (Heads) Len

func (hds Heads) Len() int

Len satisfies 'Len' in sort.Interface.

func (Heads) Less

func (hds Heads) Less(i int, j int) bool

Less satisfies 'Less' in sort.Interface.

func (Heads) Swap

func (hds Heads) Swap(i int, j int)

Swap does just that. Nothing to see here...