From b519812fa5f4335afdecdaba37177bc5e1d1d74e Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Fri, 6 Dec 2024 15:15:50 -0800 Subject: [PATCH] invalidate curDisplayKey during display changing to avoid miscapture --- .../Common/PersistentWindowProcessor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index d84305c..2bbc059 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -728,7 +728,7 @@ namespace PersistentWindows.Common restoreHalted = false; topmostWindowsFixed.Clear(); - Log.Error("Restore aborted for {0}", curDisplayKey); + Log.Error("Restore aborted for {0}", displayKey); curDisplayKey = displayKey; if (fullScreenGamingWindows.Contains(foreGroundWindow) || !normalSessions.Contains(curDisplayKey)) @@ -880,6 +880,8 @@ namespace PersistentWindows.Common WriteDataDump(); Log.Event("Display session changed, dump history in xml"); } + + curDisplayKey = "invalid_display"; } }; SystemEvents.DisplaySettingsChanging += this.displaySettingsChangingHandler;