Handle window close commands and interaction logic improvements

This commit is contained in:
Stone_Red
2026-06-08 20:47:19 +02:00
parent 169c604c7a
commit 7d8a336337
2 changed files with 24 additions and 5 deletions
+16 -1
View File
@@ -123,9 +123,24 @@ public static class WindowManager
public static void CloseWindowsForProcess(int processId)
{
List<Window> windowsToClose = new();
lock (windowsLock)
{
windows.Remove(processId);
if (windows.TryGetValue(processId, out var processWindows))
{
windowsToClose.AddRange(processWindows);
windows.Remove(processId);
}
}
if (windowsToClose.Count > 0)
{
List<RenderCommand> closeCommands = new();
foreach (var window in windowsToClose)
{
closeCommands.Add(new RenderCommand { WindowId = window.Id, ElementId = window.Id, ElementType = "WindowClose", Position = window.Position, Properties = new Dictionary<string, object?>() });
}
renderSource.Render(closeCommands);
}
}