From cfb1793dc6d5382a783d3e0e17ff37f61bdc6bba Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Wed, 29 Jan 2025 21:23:21 -0800 Subject: [PATCH] revert setting invalid curDisplayKey value causing PW stop responding --- .../Common/PersistentWindowProcessor.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index 254f2b1..0ee2d28 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -128,6 +128,7 @@ namespace PersistentWindows.Common private Object dbLock = new object(); private bool restoreHalted = false; public int haltRestore = 3000; //milliseconds to wait to finish current halted restore and restart next one + private const int immediateFinishRestore = 20; private HashSet restoredWindows = new HashSet(); private HashSet topmostWindowsFixed = new HashSet(); public bool fastRestore = true; @@ -892,8 +893,6 @@ namespace PersistentWindows.Common WriteDataDump(); Log.Event("Display session changed, dump history in xml"); } - - curDisplayKey = "invalid_display"; } }; SystemEvents.DisplaySettingsChanging += this.displaySettingsChangingHandler; @@ -967,11 +966,11 @@ namespace PersistentWindows.Common else Log.Event($"re-enter full-screen gaming mode"); - StartRestoreFinishedTimer(0); + StartRestoreFinishedTimer(immediateFinishRestore); } else { - StartRestoreFinishedTimer(0); + StartRestoreFinishedTimer(immediateFinishRestore); } } }