diff --git a/Business/App.cs b/Business/App.cs index d8c2a9b..2fe4924 100644 --- a/Business/App.cs +++ b/Business/App.cs @@ -50,21 +50,32 @@ namespace SystemTrayMenu private void TaskbarForm_Resize(object sender, EventArgs e) { - taskbarForm.WindowState = FormWindowState.Normal; + SetStateNormal(); } internal void TasbkarItemActivated(object sender, EventArgs e) { - taskbarForm.WindowState = FormWindowState.Normal; + SetStateNormal(); taskbarForm.Activate(); taskbarForm.Focus(); menus.SwitchOpenCloseByTaskbarItem(); } + private void TaskbarForm_Deactivate(object sender, EventArgs e) { - taskbarForm.WindowState = FormWindowState.Normal; + SetStateNormal(); } + /// + /// This ensures that next click on taskbaritem works as activate event/click event + /// + private void SetStateNormal() + { + if (Form.ActiveForm == taskbarForm) + { + taskbarForm.WindowState = FormWindowState.Normal; + } + } public void Dispose() { taskbarForm.Dispose(); diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 4dc32d0..83e6f69 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.11.2.0")] -[assembly: AssemblyFileVersion("0.11.2.0")] +[assembly: AssemblyVersion("0.11.2.1")] +[assembly: AssemblyFileVersion("0.11.2.1")]