Change ScreenDprMonitor to be event based

This commit is contained in:
Daniel Imms
2023-10-17 08:49:28 -07:00
parent 45605db3c5
commit 63790f8854
5 changed files with 32 additions and 30 deletions
+2 -1
View File
@@ -68,7 +68,7 @@ export class RenderService extends Disposable implements IRenderService {
this.register(this._renderDebouncer);
this._screenDprMonitor = this.register(instantiationService.createInstance(ScreenDprMonitor));
this._screenDprMonitor.setListener(() => this.handleDevicePixelRatioChange());
this.register(this._screenDprMonitor.onDprChange(() => this.handleDevicePixelRatioChange()));
this.register(bufferService.onResize(() => this._fullRefresh()));
this.register(bufferService.buffers.onBufferActivate(() => this._renderer.value?.clear()));
@@ -106,6 +106,7 @@ export class RenderService extends Disposable implements IRenderService {
// dprchange should handle this case, we need this as well for browsers that don't support the
// matchMedia query.
// TODO: Listen to window change
this.register(addDisposableDomListener(coreBrowserService.window, 'resize', () => this.handleDevicePixelRatioChange()));
this.register(themeService.onChangeColors(() => this._fullRefresh()));