From d984dec0b5685213b2336e853d9871ab8fd91878 Mon Sep 17 00:00:00 2001 From: Logan Rupe <11291831+LoganRupe@users.noreply.github.com> Date: Sat, 10 Oct 2026 20:50:24 +1100 Subject: [PATCH] fix(win/app): close every window before Application.Exit so Quit exits With the Settings window open, Application.Exit closed only some of the three windows and returned. The window it skipped (the output window in one run, Settings in another) never got a close, so the WinUI message loop kept running and the process stayed alive. A trace of Closed events showed Exit never touched the surviving window. ExitApplication now closes Settings, the panel and the output window itself, then calls Exit. Not a regression from the self-contained publish: the framework-dependent Debug build hangs the same way. Fixes #5 --- CHANGELOG.md | 2 ++ CursorFollowWin/App.xaml.cs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7897f51..7588b91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- **Windows:** Quit now exits the process. If the Settings window had been opened, the app could hang on Quit with the CursorFollow Output window still up ([#5](https://github.com/LoganRupe/CursorFollow/issues/5)). + ## 0.5.1 First public release of **CursorFollow**, open source under the MIT License at [github.com/LoganRupe/CursorFollow](https://github.com/LoganRupe/CursorFollow). Runs on **macOS**, **Windows** and **Linux (Hyprland)**. diff --git a/CursorFollowWin/App.xaml.cs b/CursorFollowWin/App.xaml.cs index e531556..bb33486 100644 --- a/CursorFollowWin/App.xaml.cs +++ b/CursorFollowWin/App.xaml.cs @@ -169,6 +169,13 @@ private void ExitApplication() _outputWindow?.DisposeCapture(); _singleInstanceMutex?.Dispose(); AppLog.Shutdown(); + + // Close every window ourselves rather than relying on Application.Exit to do it. With the + // Settings window open (three windows), Exit closed only some of them and returned; the + // window it skipped kept the message loop, and so the process, alive (issue #5). + _settingsWindow?.Close(); + _panelWindow?.Close(); + _outputWindow?.Close(); Current.Exit(); }