mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +02:00
fix exception caused by data race
This commit is contained in:
parent
bed63a11f4
commit
2d14ef2cb9
1 changed files with 10 additions and 1 deletions
|
@ -89,6 +89,7 @@ namespace PersistentWindows.Common
|
|||
private IntPtr realForeGroundWindow = IntPtr.Zero;
|
||||
public Dictionary<uint, string> processCmd = new Dictionary<uint, string>();
|
||||
private HashSet<IntPtr> fullScreenGamingWindows = new HashSet<IntPtr>();
|
||||
private IntPtr fullScreenGamingWindow = IntPtr.Zero;
|
||||
private bool exitFullScreenGaming = false;
|
||||
private POINT initCursorPos;
|
||||
private bool freezeCapture = false;
|
||||
|
@ -528,6 +529,13 @@ namespace PersistentWindows.Common
|
|||
if (restoringFromMem)
|
||||
return;
|
||||
|
||||
if (fullScreenGamingWindow == foreGroundWindow)
|
||||
{
|
||||
fullScreenGamingWindows.Add(fullScreenGamingWindow);
|
||||
fullScreenGamingWindow = IntPtr.Zero;
|
||||
return;
|
||||
}
|
||||
|
||||
if (fullScreenGamingWindows.Contains(foreGroundWindow))
|
||||
return;
|
||||
|
||||
|
@ -778,7 +786,7 @@ namespace PersistentWindows.Common
|
|||
{
|
||||
if (IsNewWindow(foreGroundWindow))
|
||||
{
|
||||
fullScreenGamingWindows.Add(foreGroundWindow);
|
||||
fullScreenGamingWindow = foreGroundWindow;
|
||||
Log.Event($"enter full-screen gaming mode {displayKey} {GetWindowTitle(foreGroundWindow)}");
|
||||
}
|
||||
else
|
||||
|
@ -1573,6 +1581,7 @@ namespace PersistentWindows.Common
|
|||
if (fullScreenGamingWindows.Contains(hwnd))
|
||||
{
|
||||
fullScreenGamingWindows.Remove(hwnd);
|
||||
fullScreenGamingWindow = IntPtr.Zero;
|
||||
exitFullScreenGaming = true;
|
||||
}
|
||||
dualPosSwitchWindows.Remove(hwnd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue