Change:
I think a class like this could be helpful: Usage: Originally posted by in
please let me know if you like this!
This class is primarily owned by Hence assigning to him.
Yes, feel free, I can review a PR, thanks.

Discussion:
export class SettingsChangeRelauncher extends Disposable implements IWorkbenchContribution { <del> private titleBarStyle: 'native' | 'custom' | undefined; private windowControlsOverlayEnabled: boolean | undefined; private windowSandboxEnabled: boolean | undefined; private nativeTabs: boolean | undefined; private nativeFullScreen: boolean | undefined; private clickThroughInactive: boolean | undefined; private updateMode: string | undefined; </del> <ins> private readonly titleBarStyle = new ChangeObserver<'native' | 'custom'>('string'); private readonly windowControlsOverlayEnabled = new ChangeObserver('boolean'); private readonly windowSandboxEnabled = new ChangeObserver('boolean'); private readonly nativeTabs = new ChangeObserver('boolean'); private readonly nativeFullScreen = new ChangeObserver('boolean'); private readonly clickThroughInactive = new ChangeObserver('boolean'); private readonly updateMode = new ChangeObserver('string'); </ins> private accessibilitySupport: 'on' | 'off' | 'auto' | undefined; <del> private workspaceTrustEnabled: boolean | undefined; private settingsProfilesEnabled: boolean | undefined; private experimentsEnabled: boolean | undefined; private enablePPEExtensionsGallery: boolean | undefined; </del> <ins> private readonly workspaceTrustEnabled = new ChangeObserver('boolean'); private readonly settingsProfilesEnabled = new ChangeObserver('boolean'); private readonly experimentsEnabled = new ChangeObserver('boolean'); private readonly enablePPEExtensionsGallery = new ChangeObserver('boolean'); </ins> constructor( @IHostService private readonly hostService: IHostService,

private onConfigurationChange(config: IConfiguration, notify: boolean): void { let changed = false; <ins> function processChanged(didChange: boolean) { changed = changed || didChange; } </ins> if (isNative) { // Titlebar style <del> if (typeof config.window?.titleBarStyle === 'string' && config.window?.titleBarStyle !== this.titleBarStyle && (config.window.titleBarStyle === 'native' || config.window.titleBarStyle === 'custom')) { this.titleBarStyle = config.window.titleBarStyle; changed = true; } </del> <ins> processChanged((config.window.titleBarStyle === 'native' || config.window.titleBarStyle === 'custom') && this.titleBarStyle.handleChange(config.window?.titleBarStyle)); </ins> // Windows: Window Controls Overlay <del> if (isWindows && typeof config.window?.experimental?.windowControlsOverlay?.enabled === 'boolean' && config.window.experimental.windowControlsOverlay.enabled !== this.windowControlsOverlayEnabled) { this.windowControlsOverlayEnabled = config.window.experimental.windowControlsOverlay.enabled; changed = true; } </del> <ins> processChanged(isWindows && this.windowControlsOverlayEnabled.handleChange(config.window?.experimental?.windowControlsOverlay?.enabled)); </ins> // Windows: Sandbox <del> if (typeof config.window?.experimental?.useSandbox === 'boolean' && config.window.experimental.useSandbox !== this.windowSandboxEnabled) { this.windowSandboxEnabled = config.window.experimental.useSandbox; changed = true; } </del> <ins> processChanged(this.windowSandboxEnabled.handleChange(config.window?.experimental?.useSandbox)); </ins> // macOS: Native tabs <del> if (isMacintosh && typeof config.window?.nativeTabs === 'boolean' && config.window.nativeTabs !== this.nativeTabs) { this.nativeTabs = config.window.nativeTabs; changed = true; } </del> <ins> processChanged(isMacintosh && this.nativeTabs.handleChange(config.window?.nativeTabs)); </ins> // macOS: Native fullscreen <del> if (isMacintosh && typeof config.window?.nativeFullScreen === 'boolean' && config.window.nativeFullScreen !== this.nativeFullScreen) { this.nativeFullScreen = config.window.nativeFullScreen; changed = true; } </del> <ins> processChanged(isMacintosh && this.nativeFullScreen.handleChange(config.window?.nativeFullScreen)); </ins> // macOS: Click through (accept first mouse) <del> if (isMacintosh && typeof config.window?.clickThroughInactive === 'boolean' && config.window.clickThroughInactive !== this.clickThroughInactive) { this.clickThroughInactive = config.window.clickThroughInactive; changed = true; } </del> <ins> processChanged(isMacintosh && this.clickThroughInactive.handleChange(config.window?.clickThroughInactive)); </ins> // Update channel <del> if (typeof config.update?.mode === 'string' && config.update.mode !== this.updateMode) { this.updateMode = config.update.mode; changed = true; } </del> <ins> processChanged(this.updateMode.handleChange(config.update?.mode)); </ins> // On linux turning on accessibility support will also pass this flag to the chrome renderer, thus a restart is required if (isLinux && typeof config.editor?.accessibilitySupport === 'string' && config.editor.accessibilitySupport !== this.accessibilitySupport) {

} // Workspace trust <del> if (typeof config?.security?.workspace?.trust?.enabled === 'boolean' && config.security?.workspace.trust.enabled !== this.workspaceTrustEnabled) { this.workspaceTrustEnabled = config.security.workspace.trust.enabled; changed = true; } </del> <ins> processChanged(this.workspaceTrustEnabled.handleChange(config?.security?.workspace?.trust?.enabled)); </ins> } // Profiles <del> if (this.productService.quality === 'stable' && typeof config.workbench?.experimental?.settingsProfiles?.enabled === 'boolean' && config.workbench.experimental.settingsProfiles.enabled !== this.settingsProfilesEnabled) { this.settingsProfilesEnabled = config.workbench.experimental.settingsProfiles.enabled; changed = true; } </del> <ins> processChanged(this.productService.quality === 'stable' && this.settingsProfilesEnabled.handleChange(config.workbench?.experimental?.settingsProfiles?.enabled)); </ins> // Experiments <del> if (typeof config.workbench?.enableExperiments === 'boolean' && config.workbench.enableExperiments !== this.experimentsEnabled) { this.experimentsEnabled = config.workbench.enableExperiments; changed = true; } </del> <ins> processChanged(this.experimentsEnabled.handleChange(config.workbench?.enableExperiments)); </ins> // Profiles <del> if (this.productService.quality !== 'stable' && typeof config._extensionsGallery?.enablePPE === 'boolean' && config._extensionsGallery?.enablePPE !== this.enablePPEExtensionsGallery) { this.enablePPEExtensionsGallery = config._extensionsGallery?.enablePPE; changed = true; } </del> <ins> processChanged(this.productService.quality !== 'stable' && this.enablePPEExtensionsGallery.handleChange(config._extensionsGallery?.enablePPE)); </ins> // Notify only when changed and we are the focused window (avoids notification spam across windows) if (notify && changed) {

} } <ins> interface TypeNameToType { readonly boolean: boolean; readonly string: string; } class ChangeObserver<T> { static create<TTypeName extends 'boolean' | 'string'>(typeName: TTypeName): ChangeObserver<TypeNameToType[TTypeName]> { return new ChangeObserver(typeName); } constructor(private readonly typeName: string) { } private lastValue: T | undefined = undefined; /** * Returns if there was a change compared to the last value */ handleChange(value: T | undefined): boolean { if (typeof value === this.typeName && value !== this.lastValue) { this.lastValue = value; return true; } return false; } } </ins> export class WorkspaceChangeExtHostRelauncher extends Disposable implements IWorkbenchContribution { private firstFolderResource?: URI;