Documentation
¶
Overview ¶
Package toplevels follows the compositor's windows over zwlr_foreign_toplevel_management_v1 on a private Wayland connection: each window's app id and whether it is the activated one. lys-ui keeps its own foreign-toplevel list internal, so this binds the protocol directly.
Index ¶
- Variables
- type Watcher
- func (w *Watcher) Close()
- func (w *Watcher) Ended() <-chan struct{}
- func (w *Watcher) Err() error
- func (w *Watcher) HandleDisplayDeleteId(ev wl.DisplayDeleteIdEvent)
- func (w *Watcher) HandleRegistryGlobal(ev wl.RegistryGlobalEvent)
- func (w *Watcher) HandleRegistryGlobalRemove(wl.RegistryGlobalRemoveEvent)
- func (w *Watcher) HandleZwlrForeignToplevelManagerV1Finished(wlr.ZwlrForeignToplevelManagerV1FinishedEvent)
- func (w *Watcher) HandleZwlrForeignToplevelManagerV1Toplevel(ev wlr.ZwlrForeignToplevelManagerV1ToplevelEvent)
- func (w *Watcher) Windows() []Window
- type Window
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("toplevels: the compositor offers no " + managerIface)
ErrUnsupported is a compositor without the foreign-toplevel manager.
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher follows the windows until Close or until the compositor goes away, which closes Ended. One goroutine reads the connection and alone closes it: Close asks the compositor to stop, and the read loop ends on its finished event.
func Watch ¶
Watch connects to the compositor named by WAYLAND_DISPLAY and follows its windows; changed runs on the watcher's goroutine after every batch that changes what Windows reports.
func (*Watcher) Close ¶
func (w *Watcher) Close()
Close stops following the windows and waits for the connection to close. When the stop cannot be sent the connection is already broken, and the read loop ends on that.
func (*Watcher) Ended ¶
func (w *Watcher) Ended() <-chan struct{}
Ended closes once the connection is gone; Err then says why.
func (*Watcher) HandleDisplayDeleteId ¶
func (w *Watcher) HandleDisplayDeleteId(ev wl.DisplayDeleteIdEvent)
HandleDisplayDeleteId frees a destroyed handle's id.
func (*Watcher) HandleRegistryGlobal ¶
func (w *Watcher) HandleRegistryGlobal(ev wl.RegistryGlobalEvent)
HandleRegistryGlobal binds the manager.
func (*Watcher) HandleRegistryGlobalRemove ¶
func (w *Watcher) HandleRegistryGlobalRemove(wl.RegistryGlobalRemoveEvent)
HandleRegistryGlobalRemove ignores globals going away; the manager's windows close on their own.
func (*Watcher) HandleZwlrForeignToplevelManagerV1Finished ¶
func (w *Watcher) HandleZwlrForeignToplevelManagerV1Finished(wlr.ZwlrForeignToplevelManagerV1FinishedEvent)
HandleZwlrForeignToplevelManagerV1Finished ends the read loop: the compositor sends no more after it.
func (*Watcher) HandleZwlrForeignToplevelManagerV1Toplevel ¶
func (w *Watcher) HandleZwlrForeignToplevelManagerV1Toplevel(ev wlr.ZwlrForeignToplevelManagerV1ToplevelEvent)
HandleZwlrForeignToplevelManagerV1Toplevel follows a new window.