fix(stage-tamagotchi): do not pause Live2D on visibility change (desktop switch) (#1410)
This commit is contained in:
@@ -21,7 +21,7 @@ describe('stage window lifecycle helpers', () => {
|
||||
...createDefaultWindowLifecycleState(),
|
||||
reason: 'hide',
|
||||
visible: false,
|
||||
})).toBe(true)
|
||||
})).toBe(false)
|
||||
|
||||
expect(shouldPauseStageFromLifecycle({
|
||||
...createDefaultWindowLifecycleState(),
|
||||
|
||||
@@ -18,7 +18,10 @@ export function createDefaultWindowLifecycleState(): ElectronWindowLifecycleStat
|
||||
}
|
||||
|
||||
export function shouldPauseStageFromLifecycle(state: ElectronWindowLifecycleState) {
|
||||
return !state.visible || state.minimized
|
||||
// When the app window is moved to another virtual desktop on Windows, it may be treated as not visible
|
||||
// by the platform even though we still need the stage to keep animating (for window capture usage).
|
||||
// Only pause when minimized, and keep running for desktop-switch visibility changes.
|
||||
return state.minimized
|
||||
}
|
||||
|
||||
export const useStageWindowLifecycleStore = defineStore('stageWindowLifecycle', () => {
|
||||
|
||||
Reference in New Issue
Block a user