Documentation ¶
Overview ¶
package heads manages state and geometry information for each physical active head detected by Xinerama. This package is also responsible for tracking which workspaces are visible and which are hidden.
Index ¶
- func Convert(rect, src, dest xrect.Rect) xrect.Rect
- type Client
- type Clients
- type Heads
- func (hds *Heads) ActivateWorkspace(wk *workspace.Workspace)
- func (hds *Heads) ActiveWorkspace() *workspace.Workspace
- func (hds *Heads) AddWorkspace(wk *workspace.Workspace)
- func (hds *Heads) ApplyStruts(clients Clients)
- func (hds *Heads) EwmhWorkarea()
- func (hds *Heads) FindMostOverlap(needle xrect.Rect) *workspace.Workspace
- func (hds *Heads) Geom(wrk *workspace.Workspace) xrect.Rect
- func (hds *Heads) GlobalIndex(wkNeedle *workspace.Workspace) int
- func (hds *Heads) HeadGeom(wrk *workspace.Workspace) xrect.Rect
- func (hds *Heads) Initialize(clients Clients)
- func (hds *Heads) IsActive(wrk *workspace.Workspace) bool
- func (hds *Heads) NewWorkspace(name string) *workspace.Workspace
- func (hds *Heads) NextWorkspace() *workspace.Workspace
- func (hds *Heads) NumConnected() int
- func (hds *Heads) NumHeads() int
- func (hds *Heads) PrevWorkspace() *workspace.Workspace
- func (hds *Heads) Reload(clients Clients)
- func (hds *Heads) RemoveWorkspace(wk *workspace.Workspace)
- func (hds *Heads) SwitchWorkspaces(wk1, wk2 *workspace.Workspace)
- func (hds *Heads) VisibleIndex(wk *workspace.Workspace) int
- func (hds *Heads) VisibleWorkspaces() []*workspace.Workspace
- func (hds *Heads) WithVisibleWorkspace(i int, f func(w *workspace.Workspace))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Heads ¶
type Heads struct { X *xgbutil.XUtil Workspaces *workspace.Workspaces // Slice of all available workspaces. // contains filtered or unexported fields }
func (*Heads) ActivateWorkspace ¶
ActivateWorkspace will "focus" or "activate" the workspace provided. This only works when "wk" is visible. To activate a hidden workspace, please use SwitchWorkspaces.
func (*Heads) ActiveWorkspace ¶
func (*Heads) AddWorkspace ¶
func (*Heads) ApplyStruts ¶
func (*Heads) EwmhWorkarea ¶
func (hds *Heads) EwmhWorkarea()
EwmhWorkarea sets the _NET_WORKAREA property. Generally, this property doesn't make much sense since multiple workspaces can be viewable at one time, and each workspace might have different workareas.
However, if the EWMH is read loosely, we can update _NET_WORKAREA not just when the struts change, but also when the configuration of visible workspaces changes. Namely, only the visible workspaces have a valid geometry set in _NET_WORKAREA, while the rest are zeroed out.
N.B. Fuck that. This interpretation of _NET_WORKAREA makes KDE go absolutely bonkers. I'm not sure if there is another sensible interpretation, so just don't set it.
func (*Heads) FindMostOverlap ¶
func (*Heads) Initialize ¶
func (*Heads) NextWorkspace ¶
func (*Heads) NumConnected ¶
NumConnected pings the Xinerama extension for a fresh tally of the number of heads currently active.
func (*Heads) PrevWorkspace ¶
func (*Heads) RemoveWorkspace ¶
func (*Heads) SwitchWorkspaces ¶
func (*Heads) VisibleWorkspaces ¶
func (*Heads) WithVisibleWorkspace ¶
WithVisibleWorkspace takes a head number and a closure and executes the closure safely with the workspace corresponding to head number i.
This approach is necessary for safety, since the user can send commands with arbitrary head numbers. We need to make sure we don't crash if we get an invalid head number.