mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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:
+10
-3
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user