mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 09:06:23 +02:00
Add process exception handling and clean window closing logic
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user