src/vs/workbench/services/host/browser/browserHostService.ts/BrowserHostService/onDidChangeFocus
class BrowserHostService:	get onDidChangeFocus(): Event<boolean> {
		const focusTracker = this._register(trackFocus(window));
		const onVisibilityChange = this._register(new DomEmitter(window.document, 'visibilitychange'));

		return Event.latch(Event.any(
			Event.map(focusTracker.onDidFocus, () => this.hasFocus),
			Event.map(focusTracker.onDidBlur, () => this.hasFocus),
			Event.map(onVisibilityChange.event, () => this.hasFocus)
		));
	}