Skip to content

Commit

Permalink
fix program blocking windows shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 6, 2019
1 parent 928e164 commit 3587685
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions KeyboardChatterBlocker/MainBlockerForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ public void StatsUpdateTimer_Tick(object sender, EventArgs e)
/// </summary>
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;
Expand Down

0 comments on commit 3587685

Please sign in to comment.