From 358768564f0881b4f328dbc454dae80cdf31d875 Mon Sep 17 00:00:00 2001 From: Alex 'mcmonkey' Goodwin Date: Tue, 6 Aug 2019 15:04:04 -0700 Subject: [PATCH] fix program blocking windows shutdown --- KeyboardChatterBlocker/MainBlockerForm.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/KeyboardChatterBlocker/MainBlockerForm.cs b/KeyboardChatterBlocker/MainBlockerForm.cs index 4629739..693ec50 100644 --- a/KeyboardChatterBlocker/MainBlockerForm.cs +++ b/KeyboardChatterBlocker/MainBlockerForm.cs @@ -200,6 +200,14 @@ public void StatsUpdateTimer_Tick(object sender, EventArgs e) /// public void MainBlockerForm_FormClosing(object sender, FormClosingEventArgs e) { + if (e.CloseReason != CloseReason.UserClosing) // Don't block windows shutdown, etc. + { + return; + } + if (IsHidden) // If already hidden, any close must be an actual full close, so close. + { + return; + } if (Program.HideInSystemTray) { e.Cancel = true;