Documentation
¶
Overview ¶
Package windowfocus activates windows created by launched Windows processes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager waits for a launched process to create a top-level window and then asks Windows to activate it.
func (*Manager) Focus ¶
Focus polls until the process owns a window that Windows accepts as foreground.
func (*Manager) HasWindowOfClass ¶ added in v2.21.0
HasWindow reports whether pid, or a process it started, owns a visible top-level window. It does not activate the window. HasWindowOfClass reports whether the process tree rooted at pid has a visible top-level window of one of the classes.
type Pending ¶ added in v2.21.0
type Pending struct {
// contains filtered or unexported fields
}
Pending is a Focus call that is running in the background. Its outcome is the earliest sign that a launched program has a window that takes input.
type Tracker ¶ added in v2.21.0
type Tracker struct {
// contains filtered or unexported fields
}
Tracker remembers the focus attempt of the process Core is tracking, so a readiness probe can wait for that process's window.
func (*Tracker) Forget ¶ added in v2.21.0
func (t *Tracker) Forget()
Forget drops the current attempt, as when its process is gone.
func (*Tracker) Track ¶ added in v2.21.0
Track starts focusing pid's window and remembers the attempt as the current one, replacing any earlier attempt.
func (*Tracker) Wait ¶ added in v2.21.0
Wait returns once the tracked process's window has taken focus. A program that opens no window within the focus timeout is treated as ready: it is not waiting on anything Core can see.
With expectProcess the wait also covers a process that is not tracked yet, as with a launcher whose media is published before its game process exists; without it, no tracked process means there is nothing to wait for.