unlock unknown display session when any window is moved/resized/minimize/unminimized

This commit is contained in:
Kang Yu 2025-03-19 15:35:44 -07:00
parent 4330c95216
commit 05a740a21f

View file

@ -2120,6 +2120,12 @@ namespace PersistentWindows.Common
break;
case User32Events.EVENT_SYSTEM_MOVESIZESTART:
if (freezeCapture)
{
Log.Event($"recognize {curDisplayKey} as user session");
freezeCapture = false; //unlock unknown display session as normal
}
if ((User32.GetKeyState(0x11) & 0x8000) != 0 //ctrl key pressed
&& (User32.GetKeyState(0x10) & 0x8000) != 0) //shift key pressed
{
@ -2133,6 +2139,12 @@ namespace PersistentWindows.Common
lastUnminimizeWindow = hwnd;
tidyTabWindows.Remove(hwnd); //no longer hidden by tidytab
if (freezeCapture)
{
Log.Event($"recognize {curDisplayKey} as user session");
freezeCapture = false; //unlock unknown display session as normal
}
if (monitorApplications.ContainsKey(curDisplayKey) && monitorApplications[curDisplayKey].ContainsKey(hwnd))
{
//treat unminimized window as foreground
@ -2161,6 +2173,12 @@ namespace PersistentWindows.Common
if (enableMinimizeToTray)
MinimizeToTray.Create(hwnd);
if (freezeCapture)
{
Log.Event($"recognize {curDisplayKey} as user session");
freezeCapture = false; //unlock unknown display session as normal
}
goto case User32Events.EVENT_SYSTEM_MOVESIZEEND;
case User32Events.EVENT_SYSTEM_MOVESIZEEND:
if (eventType == User32Events.EVENT_SYSTEM_MOVESIZEEND)