Merge pull request #2817 from Tyriar/2764
Pause cursor render layer before resuming
This commit is contained in:
@@ -302,7 +302,7 @@ class CursorBlinkStateManager {
|
|||||||
// the regular interval is setup in order to support restarting the blink
|
// the regular interval is setup in order to support restarting the blink
|
||||||
// animation in a lightweight way (without thrashing clearInterval and
|
// animation in a lightweight way (without thrashing clearInterval and
|
||||||
// setInterval).
|
// setInterval).
|
||||||
this._blinkStartTimeout = <number><any>setTimeout(() => {
|
this._blinkStartTimeout = window.setTimeout(() => {
|
||||||
// Check if another animation restart was requested while this was being
|
// Check if another animation restart was requested while this was being
|
||||||
// started
|
// started
|
||||||
if (this._animationTimeRestarted) {
|
if (this._animationTimeRestarted) {
|
||||||
@@ -322,7 +322,7 @@ class CursorBlinkStateManager {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Setup the blink interval
|
// Setup the blink interval
|
||||||
this._blinkInterval = <number><any>setInterval(() => {
|
this._blinkInterval = window.setInterval(() => {
|
||||||
// Adjust the animation time if it was restarted
|
// Adjust the animation time if it was restarted
|
||||||
if (this._animationTimeRestarted) {
|
if (this._animationTimeRestarted) {
|
||||||
// calc time diff
|
// calc time diff
|
||||||
@@ -360,6 +360,9 @@ class CursorBlinkStateManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public resume(terminal: Terminal): void {
|
public resume(terminal: Terminal): void {
|
||||||
|
// Clear out any existing timers just in case
|
||||||
|
this.pause();
|
||||||
|
|
||||||
this._animationTimeRestarted = undefined;
|
this._animationTimeRestarted = undefined;
|
||||||
this._restartInterval();
|
this._restartInterval();
|
||||||
this.restartBlinkAnimation(terminal);
|
this.restartBlinkAnimation(terminal);
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ class CursorBlinkStateManager {
|
|||||||
// the regular interval is setup in order to support restarting the blink
|
// the regular interval is setup in order to support restarting the blink
|
||||||
// animation in a lightweight way (without thrashing clearInterval and
|
// animation in a lightweight way (without thrashing clearInterval and
|
||||||
// setInterval).
|
// setInterval).
|
||||||
this._blinkStartTimeout = <number><any>setTimeout(() => {
|
this._blinkStartTimeout = window.setTimeout(() => {
|
||||||
// Check if another animation restart was requested while this was being
|
// Check if another animation restart was requested while this was being
|
||||||
// started
|
// started
|
||||||
if (this._animationTimeRestarted) {
|
if (this._animationTimeRestarted) {
|
||||||
@@ -326,7 +326,7 @@ class CursorBlinkStateManager {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Setup the blink interval
|
// Setup the blink interval
|
||||||
this._blinkInterval = <number><any>setInterval(() => {
|
this._blinkInterval = window.setInterval(() => {
|
||||||
// Adjust the animation time if it was restarted
|
// Adjust the animation time if it was restarted
|
||||||
if (this._animationTimeRestarted) {
|
if (this._animationTimeRestarted) {
|
||||||
// calc time diff
|
// calc time diff
|
||||||
@@ -364,6 +364,9 @@ class CursorBlinkStateManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public resume(): void {
|
public resume(): void {
|
||||||
|
// Clear out any existing timers just in case
|
||||||
|
this.pause();
|
||||||
|
|
||||||
this._animationTimeRestarted = undefined;
|
this._animationTimeRestarted = undefined;
|
||||||
this._restartInterval();
|
this._restartInterval();
|
||||||
this.restartBlinkAnimation();
|
this.restartBlinkAnimation();
|
||||||
|
|||||||
Reference in New Issue
Block a user