fixed error where mrng would never close when set to "minimize to tray on close"

This commit is contained in:
Faryan Rezagholi
2019-10-01 14:01:10 +02:00
parent ab5b58f3ae
commit 4c08d06e93

View File

@@ -372,9 +372,13 @@ namespace mRemoteNG.UI.Forms
if (Runtime.NotificationAreaIcon == null)
Runtime.NotificationAreaIcon = new NotificationAreaIcon();
Hide();
e.Cancel = true;
return;
if (WindowState == FormWindowState.Normal || WindowState == FormWindowState.Maximized)
{
Hide();
WindowState = FormWindowState.Minimized;
e.Cancel = true;
return;
}
}
if (!(Runtime.WindowList == null || Runtime.WindowList.Count == 0))