From e8f06c1368519e328952866daa0c485918566a11 Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Sat, 3 May 2025 16:15:24 -0700 Subject: [PATCH] no need to write xml when restore finished, as it is done in session end --- .../Common/PersistentWindowProcessor.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index 08a63b5..805b477 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -769,8 +769,6 @@ namespace PersistentWindows.Common Log.Event("Restore finished in pass {0} with {1} windows recovered for display setting {2}", restorePass, numWindowRestored, curDisplayKey); sessionActive = true; - WriteDataDump(); - if (!wasRestoringSnapshot && !wasRestoringFromDB) { if (!snapshotTakenTime.ContainsKey(curDisplayKey)) @@ -865,6 +863,7 @@ namespace PersistentWindows.Common (s, e) => { process.PriorityClass = ProcessPriorityClass.High; + EndDisplaySession(); WriteDataDump(); Log.Event("Session ending"); }; @@ -873,6 +872,9 @@ namespace PersistentWindows.Common this.displaySettingsChangingHandler = (s, e) => { + if (fastRestore) + process.PriorityClass = ProcessPriorityClass.High; + if (!freezeCapture) { lastDisplayChangeTime = DateTime.Now; @@ -895,9 +897,6 @@ namespace PersistentWindows.Common this.displaySettingsChangedHandler = (s, e) => { - if (fastRestore) - process.PriorityClass = ProcessPriorityClass.High; - string displayKey = GetDisplayKey(); Log.Event("Display settings changed {0}", displayKey);