diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 6580c62..a30594f 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -39,5 +39,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("1.3.0.5")] -[assembly: AssemblyFileVersion("1.3.0.5")] +[assembly: AssemblyVersion("1.3.0.6")] +[assembly: AssemblyFileVersion("1.3.0.6")] diff --git a/README.md b/README.md index b0b3aed..b54e7ab 100644 --- a/README.md +++ b/README.md @@ -275,7 +275,7 @@ Thanks for ideas, reporting issues and contributing! #285 #286 [dao-net](https://github.com/dao-net), #288 William P., #294 #295 #296 Stefan Mahrer, -#225 #297 #299 #317 #321 #324 #330 #386 #390 #401 #402 #407 #409 #414 [chip33](https://github.com/chip33), +#225 #297 #299 #317 #321 #324 #330 #386 #390 #401 #402 #407 #409 #414 #416 [chip33](https://github.com/chip33), #298 [phanirithvij](https://github.com/phanirithvij), #306 [wini2](https://github.com/wini2), #370 [dna5589](https://github.com/dna5589), diff --git a/UserInterface/AppContextMenu.cs b/UserInterface/AppContextMenu.cs index 39d12eb..e022aa1 100644 --- a/UserInterface/AppContextMenu.cs +++ b/UserInterface/AppContextMenu.cs @@ -89,7 +89,7 @@ namespace SystemTrayMenu.Helper aboutBox.AppMoreInfo += "#235 #242 243 #247, #271 Tom, #237 Torsten S., #240 video Patrick, #244 Gunter D., #246 #329 MACE4GITHUB, #259 #310 vanjac, "; aboutBox.AppMoreInfo += "#262 terencemcdonnell, #269 petersnows25, #272 Peter M., #273 #274 ParasiteDelta, #275 #276 #278 donaldaken, "; aboutBox.AppMoreInfo += "#277 Jan S., #282 akuznets, #283 #284 #289 RuSieg, #285 #286 dao-net, #288 William P., #294 #295 #296 Stefan Mahrer, "; - aboutBox.AppMoreInfo += "#225 #297 #299 #317 #321 #324 #330 #386 #390 #401 #402 #407 #409 #414 chip33, #298 phanirithvij, #306 wini2, #370 dna5589, #372 not-nef, #376 Michelle H. "; + aboutBox.AppMoreInfo += "#225 #297 #299 #317 #321 #324 #330 #386 #390 #401 #402 #407 #409 #414 #416 chip33, #298 phanirithvij, #306 wini2, #370 dna5589, #372 not-nef, #376 Michelle H. "; aboutBox.AppMoreInfo += "#377 SoenkeHob, #380 #394 TransLucida, #384 boydfields, #386 visusys, #387 #411 yrctw" + Environment.NewLine; aboutBox.AppMoreInfo += @" Sponsors - Thank you! diff --git a/UserInterface/Menu.cs b/UserInterface/Menu.cs index c4417da..7c80c9f 100644 --- a/UserInterface/Menu.cs +++ b/UserInterface/Menu.cs @@ -9,6 +9,7 @@ namespace SystemTrayMenu.UserInterface using System.Drawing; using System.Globalization; using System.Reflection; + using System.Threading; using System.Windows.Forms; using SystemTrayMenu.DataClasses; using SystemTrayMenu.DllImports; @@ -1100,7 +1101,7 @@ namespace SystemTrayMenu.UserInterface { if (e.Button == MouseButtons.Left) { - SettingsForm.ShowSingleInstance(this); + new Thread(SettingsForm.ShowSingleInstance).Start(); } } diff --git a/UserInterface/SettingsForm.cs b/UserInterface/SettingsForm.cs index 512c201..4aed212 100644 --- a/UserInterface/SettingsForm.cs +++ b/UserInterface/SettingsForm.cs @@ -589,23 +589,16 @@ namespace SystemTrayMenu.UserInterface return RegisterHotkeys(false); } - public static void ShowSingleInstance(IWin32Window owner = null) + public static void ShowSingleInstance() { if (IsOpen()) { - settingsForm.Activate(); + settingsForm.HandleInvoke(settingsForm.Activate); } else { settingsForm = new(); - if (owner == null) - { - settingsForm.ShowDialog(); - } - else - { - settingsForm.Show(owner); - } + settingsForm.ShowDialog(); } } diff --git a/Utilities/FormsExtensions.cs b/Utilities/FormsExtensions.cs new file mode 100644 index 0000000..309da22 --- /dev/null +++ b/Utilities/FormsExtensions.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) PlaceholderCompany. All rights reserved. +// + +namespace SystemTrayMenu.Utilities +{ + using System; + using System.Windows.Forms; + + internal static class FormsExtensions + { + public static void HandleInvoke(this Control instance, Action action) + { + if (instance.InvokeRequired) + { + instance.Invoke(action); + } + else + { + action(); + } + } + } +}