invalidate curDisplayKey during display changing to avoid miscapture

This commit is contained in:
Kang Yu 2024-12-06 15:15:50 -08:00
parent cf4a966e28
commit b519812fa5

View file

@ -728,7 +728,7 @@ namespace PersistentWindows.Common
restoreHalted = false; restoreHalted = false;
topmostWindowsFixed.Clear(); topmostWindowsFixed.Clear();
Log.Error("Restore aborted for {0}", curDisplayKey); Log.Error("Restore aborted for {0}", displayKey);
curDisplayKey = displayKey; curDisplayKey = displayKey;
if (fullScreenGamingWindows.Contains(foreGroundWindow) || !normalSessions.Contains(curDisplayKey)) if (fullScreenGamingWindows.Contains(foreGroundWindow) || !normalSessions.Contains(curDisplayKey))
@ -880,6 +880,8 @@ namespace PersistentWindows.Common
WriteDataDump(); WriteDataDump();
Log.Event("Display session changed, dump history in xml"); Log.Event("Display session changed, dump history in xml");
} }
curDisplayKey = "invalid_display";
} }
}; };
SystemEvents.DisplaySettingsChanging += this.displaySettingsChangingHandler; SystemEvents.DisplaySettingsChanging += this.displaySettingsChangingHandler;