#300, add command option -ctrl_minimize_to_tray=0 to disable the feature

This commit is contained in:
Kang Yu 2024-03-01 13:11:11 -08:00
parent 8b08fb3d07
commit 006aa4e517
2 changed files with 6 additions and 1 deletions

View file

@ -116,6 +116,8 @@ namespace PersistentWindows.Common
public bool enableDualPosSwitch = true; public bool enableDualPosSwitch = true;
private HashSet<IntPtr> dualPosSwitchWindows = new HashSet<IntPtr>(); private HashSet<IntPtr> dualPosSwitchWindows = new HashSet<IntPtr>();
public bool enableMinimizeToTray = true;
private Dictionary<string, string> realProcessFileName = new Dictionary<string, string>() private Dictionary<string, string> realProcessFileName = new Dictionary<string, string>()
{ {
{ "WindowsTerminal.exe", "wt.exe"}, { "WindowsTerminal.exe", "wt.exe"},
@ -1574,7 +1576,7 @@ namespace PersistentWindows.Common
foreGroundWindow = IntPtr.Zero; foreGroundWindow = IntPtr.Zero;
} }
if (!shift_key_pressed && !alt_key_pressed) if (enableMinimizeToTray)
MinimizeToTray.Create(hwnd); MinimizeToTray.Create(hwnd);
goto case User32Events.EVENT_SYSTEM_MOVESIZEEND; goto case User32Events.EVENT_SYSTEM_MOVESIZEEND;

View file

@ -184,6 +184,9 @@ namespace PersistentWindows.SystrayShell
case "-foreground_background_dual_position=0": case "-foreground_background_dual_position=0":
pwp.enableDualPosSwitch = false; pwp.enableDualPosSwitch = false;
break; break;
case "-ctrl_minimize_to_tray=0":
pwp.enableMinimizeToTray = false;
break;
case "-prompt_session_restore": case "-prompt_session_restore":
prompt_session_restore = true; prompt_session_restore = true;
break; break;