Fixed exit when running
This commit is contained in:
parent
b4cb6ee8c8
commit
3188cda3e4
@ -69,7 +69,17 @@ namespace CursorGuardRail
|
||||
|
||||
protected override void OnFormClosing(FormClosingEventArgs e)
|
||||
{
|
||||
if ((this.HideOnClose && !_requestExit) || _timer.Enabled)
|
||||
// On exit requested, exit
|
||||
if (_requestExit)
|
||||
{
|
||||
if (_timer.Enabled) _timer.Stop();
|
||||
|
||||
ClipCursor(Rectangle.Empty);
|
||||
return;
|
||||
}
|
||||
|
||||
// Always hide instead of close, if running
|
||||
if (this.HideOnClose || _timer.Enabled)
|
||||
{
|
||||
e.Cancel = true;
|
||||
|
||||
@ -77,10 +87,6 @@ namespace CursorGuardRail
|
||||
return;
|
||||
}
|
||||
|
||||
if (_timer.Enabled) _timer.Stop();
|
||||
|
||||
ClipCursor(Rectangle.Empty);
|
||||
|
||||
base.OnFormClosing(e);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user