Skip to content

Commit a3f1cea

Browse files
committed
ui: use console fallback for helper parents
Helper commands resolve their parent handle independently of the in-process authentication path. Keeping only the explicit-HWND case would leave their default parent-selection policy inconsistent with the shared authentication lookup. Use the same visible-console fallback when no handle is configured. Explicit handles still take precedence, and a missing or hidden console leaves the parent unset. Assisted-by: GPT-6.1 Sol Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
1 parent 601b7ad commit a3f1cea

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/Core/UI/HelperCommand.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,19 @@ public HelperCommand(ICommandContext context, string name, string description)
1616

1717
protected IntPtr GetParentHandle()
1818
{
19+
// Check if the user has specified a parent window ID
1920
if (int.TryParse(Context.Settings.ParentWindowId, out int id))
2021
{
2122
return new IntPtr(id);
2223
}
2324

25+
// Check if we can use the console window as a parent
26+
IntPtr consoleParent = PlatformUtils.GetConsoleParentWindow();
27+
if (consoleParent != IntPtr.Zero)
28+
{
29+
return consoleParent;
30+
}
31+
2432
return IntPtr.Zero;
2533
}
2634

0 commit comments

Comments
 (0)