@@ -713,7 +713,7 @@ class EditorRenderingCoordinator {
713
713
public static INSTANCE = new EditorRenderingCoordinator ( ) ;
714
714
715
715
private _coordinatedRenderings : ICoordinatedRendering [ ] = [ ] ;
716
- private _animationFrameRunner : IDisposable | null = null ;
716
+ private _animationFrameRunners = new Map < CodeWindow , IDisposable > ( ) ;
717
717
718
718
private constructor ( ) { }
719
719
@@ -729,23 +729,23 @@ class EditorRenderingCoordinator {
729
729
this . _coordinatedRenderings . splice ( renderingIndex , 1 ) ;
730
730
731
731
if ( this . _coordinatedRenderings . length === 0 ) {
732
- // There are no more renderings to coordinate => cancel animation frame
733
- if ( this . _animationFrameRunner !== null ) {
734
- this . _animationFrameRunner . dispose ( ) ;
735
- this . _animationFrameRunner = null ;
732
+ // There are no more renderings to coordinate => cancel animation frames
733
+ for ( const [ _ , disposable ] of this . _animationFrameRunners ) {
734
+ disposable . dispose ( ) ;
736
735
}
736
+ this . _animationFrameRunners . clear ( ) ;
737
737
}
738
738
}
739
739
} ;
740
740
}
741
741
742
742
private _scheduleRender ( window : CodeWindow ) : void {
743
- if ( this . _animationFrameRunner === null ) {
743
+ if ( ! this . _animationFrameRunners . has ( window ) ) {
744
744
const runner = ( ) => {
745
- this . _animationFrameRunner = null ;
745
+ this . _animationFrameRunners . delete ( window ) ;
746
746
this . _onRenderScheduled ( ) ;
747
747
} ;
748
- this . _animationFrameRunner = dom . runAtThisOrScheduleAtNextAnimationFrame ( window , runner , 100 ) ;
748
+ this . _animationFrameRunners . set ( window , dom . runAtThisOrScheduleAtNextAnimationFrame ( window , runner , 100 ) ) ;
749
749
}
750
750
}
751
751
0 commit comments