From 006aa4e517fcdf29f677fe20a41d9c66703334c1 Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Fri, 1 Mar 2024 13:11:11 -0800 Subject: [PATCH] #300, add command option -ctrl_minimize_to_tray=0 to disable the feature --- .../Common/PersistentWindowProcessor.cs | 4 +++- Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index 7d0aa0a..dff6127 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -116,6 +116,8 @@ namespace PersistentWindows.Common public bool enableDualPosSwitch = true; private HashSet dualPosSwitchWindows = new HashSet(); + public bool enableMinimizeToTray = true; + private Dictionary realProcessFileName = new Dictionary() { { "WindowsTerminal.exe", "wt.exe"}, @@ -1574,7 +1576,7 @@ namespace PersistentWindows.Common foreGroundWindow = IntPtr.Zero; } - if (!shift_key_pressed && !alt_key_pressed) + if (enableMinimizeToTray) MinimizeToTray.Create(hwnd); goto case User32Events.EVENT_SYSTEM_MOVESIZEEND; diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs index f3f1274..7b9162c 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs @@ -184,6 +184,9 @@ namespace PersistentWindows.SystrayShell case "-foreground_background_dual_position=0": pwp.enableDualPosSwitch = false; break; + case "-ctrl_minimize_to_tray=0": + pwp.enableMinimizeToTray = false; + break; case "-prompt_session_restore": prompt_session_restore = true; break;