fix crash

This commit is contained in:
Kang Yu 2024-11-19 22:17:49 -08:00
parent 0d6940b6ec
commit fffdf03c10

View file

@ -552,11 +552,13 @@ namespace PersistentWindows.Common
{
if (!sessionActive) //disable foreground event handling
return;
IntPtr hwnd = foreGroundWindow;
if (!User32.IsWindow(hwnd))
return;
if (hwnd == fullScreenGamingWindow)
return;
if (noRestoreWindows.Contains(hwnd))
return;
@ -629,6 +631,9 @@ namespace PersistentWindows.Common
if (!monitorApplications[curDisplayKey].ContainsKey(hwnd))
{
if (!normalSessions.Contains(curDisplayKey))
return;
var appWindows = CaptureWindowsOfInterest();
DateTime now = DateTime.Now;
foreach (var h in appWindows)