Do not show CmdPal on startup (#38027)

Adds a command line arg to not show CmdPal on startup. When starting from PT Run, we won't immediately show the window. 

as noted in #37908
This commit is contained in:
Stefan Markovic
2025-03-20 15:48:15 +01:00
committed by GitHub
parent 68f76409ab
commit dadd306555
3 changed files with 39 additions and 20 deletions

View File

@@ -64,7 +64,23 @@ public partial class App : Application
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
AppWindow = new MainWindow();
AppWindow.Activate();
var cmdArgs = Environment.GetCommandLineArgs();
bool runFromPT = false;
foreach (var arg in cmdArgs)
{
if (arg == "RunFromPT")
{
runFromPT = true;
break;
}
}
if (!runFromPT)
{
AppWindow.Activate();
}
}
/// <summary>

View File

@@ -466,6 +466,8 @@ public sealed partial class MainWindow : Window,
// so that we can bind hotkeys to individual commands
if (!this.Visible || !isRootHotkey)
{
Activate();
Summon(hotkey.CommandId);
}
else if (isRootHotkey)