Add process exception handling and clean window closing logic

This commit is contained in:
Stone_Red
2026-06-08 20:34:25 +02:00
parent 82efb8d967
commit 169c604c7a
4 changed files with 32 additions and 10 deletions
+8 -3
View File
@@ -53,7 +53,7 @@ public static class WindowManager
wasLeftButtonDown = leftButtonDown;
if (KeyboardManager.TryReadKey(out KeyEvent keyEvent))
while (KeyboardManager.TryReadKey(out KeyEvent keyEvent))
{
focusedWindow?.HandleKeyEvent(keyEvent);
}
@@ -99,7 +99,7 @@ public static class WindowManager
processWindows.Remove(window);
}
}
renderSource.Render(new[] { new RenderCommand { WindowId = window.Id, ElementId = window.Id, ElementType = "WindowClose", Position = window.Position, Properties = new Dictionary<string, object?>() } });
}
@@ -117,10 +117,15 @@ public static class WindowManager
}
public static void CloseWindowsForProcess(Process process)
{
CloseWindowsForProcess(process.Id);
}
public static void CloseWindowsForProcess(int processId)
{
lock (windowsLock)
{
windows.Remove(process.Id);
windows.Remove(processId);
}
}