diff --git a/YAPA/Plugins/MinimizeToTray/SystemTray.cs b/YAPA/Plugins/MinimizeToTray/SystemTray.cs index 01dba9f..ff1cac9 100644 --- a/YAPA/Plugins/MinimizeToTray/SystemTray.cs +++ b/YAPA/Plugins/MinimizeToTray/SystemTray.cs @@ -7,6 +7,7 @@ using System.Windows.Forms; using System.Windows.Input; using YAPA.Shared.Contracts; +using MouseEventArgs = System.Windows.Forms.MouseEventArgs; namespace YAPA.Plugins.MinimizeToTray { @@ -51,7 +52,7 @@ public SystemTray(IApplication app, IMainViewModel viewModel, SystemTraySettings Visible = SystemTrayVisible() }; - _sysTrayIcon.DoubleClick += SysTrayIcon_DoubleClick; + _sysTrayIcon.MouseClick += SysTrayIcon_MouseClick; _viewModel.Engine.PropertyChanged += _engine_PropertyChanged; @@ -197,8 +198,11 @@ private void _app_StateChanged(ApplicationState state) } } - private void SysTrayIcon_DoubleClick(object sender, EventArgs e) + private void SysTrayIcon_MouseClick(object sender, MouseEventArgs e) { + if (e.Button != MouseButtons.Left) + return; + _app.Show(); _app.AppState = ApplicationState.Normal; }