mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-12 13:35: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;
|
private IntPtr realForeGroundWindow = IntPtr.Zero;
|
||||||
public Dictionary<uint, string> processCmd = new Dictionary<uint, string>();
|
public Dictionary<uint, string> processCmd = new Dictionary<uint, string>();
|
||||||
private HashSet<IntPtr> fullScreenGamingWindows = new HashSet<IntPtr>();
|
private HashSet<IntPtr> fullScreenGamingWindows = new HashSet<IntPtr>();
|
||||||
|
private IntPtr fullScreenGamingWindow = IntPtr.Zero;
|
||||||
private bool exitFullScreenGaming = false;
|
private bool exitFullScreenGaming = false;
|
||||||
private POINT initCursorPos;
|
private POINT initCursorPos;
|
||||||
private bool freezeCapture = false;
|
private bool freezeCapture = false;
|
||||||
|
@ -528,6 +529,13 @@ namespace PersistentWindows.Common
|
||||||
if (restoringFromMem)
|
if (restoringFromMem)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (fullScreenGamingWindow == foreGroundWindow)
|
||||||
|
{
|
||||||
|
fullScreenGamingWindows.Add(fullScreenGamingWindow);
|
||||||
|
fullScreenGamingWindow = IntPtr.Zero;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (fullScreenGamingWindows.Contains(foreGroundWindow))
|
if (fullScreenGamingWindows.Contains(foreGroundWindow))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -778,7 +786,7 @@ namespace PersistentWindows.Common
|
||||||
{
|
{
|
||||||
if (IsNewWindow(foreGroundWindow))
|
if (IsNewWindow(foreGroundWindow))
|
||||||
{
|
{
|
||||||
fullScreenGamingWindows.Add(foreGroundWindow);
|
fullScreenGamingWindow = foreGroundWindow;
|
||||||
Log.Event($"enter full-screen gaming mode {displayKey} {GetWindowTitle(foreGroundWindow)}");
|
Log.Event($"enter full-screen gaming mode {displayKey} {GetWindowTitle(foreGroundWindow)}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1573,6 +1581,7 @@ namespace PersistentWindows.Common
|
||||||
if (fullScreenGamingWindows.Contains(hwnd))
|
if (fullScreenGamingWindows.Contains(hwnd))
|
||||||
{
|
{
|
||||||
fullScreenGamingWindows.Remove(hwnd);
|
fullScreenGamingWindows.Remove(hwnd);
|
||||||
|
fullScreenGamingWindow = IntPtr.Zero;
|
||||||
exitFullScreenGaming = true;
|
exitFullScreenGaming = true;
|
||||||
}
|
}
|
||||||
dualPosSwitchWindows.Remove(hwnd);
|
dualPosSwitchWindows.Remove(hwnd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue