feat: show no-WFB kiosk fallback only while video absent (#2)
Build Ground Station / build (push) Successful in 44s
Build Ground Station / build (push) Successful in 44s
This commit was merged in pull request #9.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package display
|
||||
|
||||
import "sync/atomic"
|
||||
|
||||
// VideoPresence is the shared decoded-video signal between a display target
|
||||
// session and the templates it drives. Sessions update it from
|
||||
// display-server events about the video output itself: a presented video
|
||||
// window is presence, its unmap or destroy is video end. Nothing here
|
||||
// inspects WFB or launcher processes, so a running-but-silent receiver never
|
||||
// hides the fallback and the video pipeline is never touched.
|
||||
type VideoPresence struct {
|
||||
active atomic.Bool
|
||||
}
|
||||
|
||||
// NewVideoPresence starts with video absent, so the fallback is visible
|
||||
// before the first presented video output.
|
||||
func NewVideoPresence() *VideoPresence {
|
||||
return &VideoPresence{}
|
||||
}
|
||||
|
||||
// Active reports whether decoded video output is being presented.
|
||||
func (p *VideoPresence) Active() bool {
|
||||
return p.active.Load()
|
||||
}
|
||||
|
||||
// SetActive records video presence and reports whether the state changed, so
|
||||
// callers can trigger exactly one redraw per lifecycle transition.
|
||||
func (p *VideoPresence) SetActive(active bool) bool {
|
||||
return p.active.Swap(active) != active
|
||||
}
|
||||
Reference in New Issue
Block a user