Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions app/src/lib/stores/app-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1071,10 +1071,12 @@ export class AppStore extends TypedBaseStore<IAppState> {
}

protected emitUpdate() {
// If the window is hidden then we won't get an animation frame, but there
// may still be work we wanna do in response to the state change. So
// immediately emit the update.
if (this.windowState === 'hidden') {
// If the window is hidden or not focused then we won't reliably get
// animation frames (especially on Windows where Chromium throttles
// requestAnimationFrame for unfocused windows), but there may still be
// work we wanna do in response to the state change. So immediately emit
// the update.
if (this.windowState === 'hidden' || !this.appIsFocused) {
this.emitUpdateNow()
return
}
Expand Down