diff --git a/src/vs/workbench/parts/git/browser/gitServices.ts b/src/vs/workbench/parts/git/browser/gitServices.ts index af4d7df93aa..ffc3e9b8a20 100644 --- a/src/vs/workbench/parts/git/browser/gitServices.ts +++ b/src/vs/workbench/parts/git/browser/gitServices.ts @@ -410,7 +410,6 @@ export class GitService extends EventEmitter private reactiveStatusDelayer: PeriodThrottledDelayer; private autoFetcher: AutoFetcher; private isStatusPending = false; - private isFocused = true; private _allowHugeRepositories: boolean; get allowHugeRepositories(): boolean { return this._allowHugeRepositories; } @@ -518,15 +517,10 @@ export class GitService extends EventEmitter const focusEvent = domEvent(window, 'focus'); this.toDispose.push(focusEvent(() => { - this.isFocused = true; - if (this.isStatusPending) { this.triggerAutoStatus(); } })); - - const blurEvent = domEvent(window, 'blur'); - this.toDispose.push(blurEvent(() => this.isFocused = false)); } private onTextFileChange(e: TextFileModelChangeEvent): void { @@ -615,7 +609,7 @@ export class GitService extends EventEmitter private triggerAutoStatus(force = false): void { this.isStatusPending = true; - if (!this.isFocused && !force) { + if (!document.hasFocus() && !force) { return; }