app,io/system: [API] add StageInactive when window is not in focus

Now, Gio will send one system.StageEvent with system.StageInactive when
the window is not active. It is implemented on macOS and Windows.

This change is not fully backward compatible, if your code compares
the Stage (`stage < system.StageRunning`), you need to consider
the new system.StageInactive.

Signed-off-by: inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
Inkeliz
2022-08-20 17:30:50 +01:00
committed by Elias Naur
parent b1dba5f27d
commit 90688fdd17
6 changed files with 32 additions and 9 deletions
+10 -3
View File
@@ -59,17 +59,24 @@ type StageEvent struct {
type Stage uint8
const (
// StagePaused is the Stage for inactive Windows.
// Inactive Windows don't receive FrameEvents.
// StagePaused is the stage for windows that have no on-screen representation.
// Paused windows don't receive FrameEvent.
StagePaused Stage = iota
// StateRunning is for active Windows.
// StageInactive is the stage for windows that are visible, but not active.
// Inactive windows receive FrameEvent.
StageInactive
// StageRunning is for active and visible Windows.
// Running windows receive FrameEvent.
StageRunning
)
// String implements fmt.Stringer.
func (l Stage) String() string {
switch l {
case StagePaused:
return "StagePaused"
case StageInactive:
return "StageInactive"
case StageRunning:
return "StageRunning"
default: