From 7d431a22f1608d71905de95842d526e5ff4db49b Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Tue, 10 Dec 2024 18:27:42 -0800 Subject: [PATCH] disable UndoCapture() for full screen gaming session --- .../Common/PersistentWindowProcessor.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index 475fa13..c2b03b2 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -93,6 +93,7 @@ namespace PersistentWindows.Common public Dictionary processCmd = new Dictionary(); private HashSet fullScreenGamingWindows = new HashSet(); private HashSet fullScreenGamingProcesses = new HashSet(); + private HashSet fullScreenGamingConfig = new HashSet(); private IntPtr fullScreenGamingWindow = IntPtr.Zero; private bool exitFullScreenGaming = false; private POINT initCursorPos; @@ -876,7 +877,9 @@ namespace PersistentWindows.Common if (normalSessions.Contains(curDisplayKey)) { // rewind disqualified capture time - UndoCapture(lastDisplayChangeTime); + string display_key = GetDisplayKey(); + if (!fullScreenGamingConfig.Contains(display_key)) + UndoCapture(lastDisplayChangeTime); WriteDataDump(); Log.Event("Display session changed, dump history in xml"); @@ -947,6 +950,7 @@ namespace PersistentWindows.Common { fullScreenGamingWindow = foreGroundWindow; fullScreenGamingProcesses.Add(windowProcessName[fullScreenGamingWindow]); + fullScreenGamingConfig.Add(displayKey); if (IsNewWindow(foreGroundWindow)) { fullScreenGamingWindows.Add(fullScreenGamingWindow);