From 4ad85f57ecc65c0a842ff94e9fca26f23d91e5d1 Mon Sep 17 00:00:00 2001 From: Mute Date: Sun, 9 Aug 2026 11:33:36 +0000 Subject: [PATCH] Close button quits app instead of hiding to tray MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - OnFormClosing no longer intercepts close button — app quits on X - Minimize still hides to tray (OnResize unchanged) - Removed unused _closingFromTray flag - Tray Exit and tray double-click restore unchanged --- MainForm.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/MainForm.cs b/MainForm.cs index 7c225a1..4969af6 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -21,8 +21,6 @@ public class MainForm : Form readonly System.Windows.Forms.Timer _statusTimer; readonly CancellationTokenSource _loopCts; - bool _closingFromTray; - readonly HeatMap _heatA; readonly HeatMap _heatB; readonly ProgressBar _gaugeRecvA; @@ -377,7 +375,6 @@ public class MainForm : Form void ExitFromTray() { - _closingFromTray = true; _tray.Visible = false; Application.Exit(); } @@ -390,12 +387,6 @@ public class MainForm : Form void OnFormClosing(object? sender, FormClosingEventArgs e) { - if (e.CloseReason == CloseReason.UserClosing && !_closingFromTray) - { - e.Cancel = true; - Hide(); - return; - } _tray.Visible = false; _statusTimer.Stop(); _loopCts.Cancel();