reduce number of restore effort to speed up recovery

This commit is contained in:
Kang Yu 2020-02-29 15:34:20 -08:00
parent 528d1e783d
commit 29f24db354

View file

@ -17,9 +17,9 @@ namespace Ninjacrab.PersistentWindows.Common
// constant // constant
private const int RestoreLatency = 500; // milliseconds to wait for next pass of window position recovery private const int RestoreLatency = 500; // milliseconds to wait for next pass of window position recovery
private const int MaxRestoreLatency = 5000; // max milliseconds to wait after previous restore pass to tell if restore is finished private const int MaxRestoreLatency = 5000; // max milliseconds to wait after previous restore pass to tell if restore is finished
private const int MinRestoreTimes = 4; // restores with fixed RestoreLatency private const int MinRestoreTimes = 2; // restores with fixed RestoreLatency
private const int MaxRestoreTimesLocal = 6; // Max restores activated by further window event for local console session private const int MaxRestoreTimesLocal = 4; // Max restores activated by further window event for local console session
private const int MaxRestoreTimesRemote = 10; // for remote session private const int MaxRestoreTimesRemote = 6; // for remote session
private const int CaptureLatency = 3000; // milliseconds to wait for window position capture, should be bigger than RestoreLatency private const int CaptureLatency = 3000; // milliseconds to wait for window position capture, should be bigger than RestoreLatency
private const int MaxCaptureLatency = 15000; // max latency to capture OS moves, needed for slow RDP session private const int MaxCaptureLatency = 15000; // max latency to capture OS moves, needed for slow RDP session
@ -150,7 +150,7 @@ namespace Ninjacrab.PersistentWindows.Common
ResetState(); ResetState();
restoringWindowPos = true; restoringWindowPos = true;
BeginRestoreApplicationsOnCurrentDisplays(); StartRestoreTimer();
}; };
SystemEvents.DisplaySettingsChanged += this.displaySettingsChangedHandler; SystemEvents.DisplaySettingsChanged += this.displaySettingsChangedHandler;