Files
ClaudeDo/src/ClaudeDo.Ui/Services/ForegroundHelper.cs
T
mika kunsandClaude Opus 4.7 b7c60f5838 feat(ui): live task updates from worker events + planning polish
Wire TasksIslandViewModel to TaskUpdated/WorktreeUpdated/TaskMessage worker
events so rows refresh without a full reload; add ForegroundHelper to permit
wt.exe to take foreground on planning launch; misc UI polish on lists, task
rows and settings modal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:12:27 +02:00

20 lines
615 B
C#

using System.Runtime.InteropServices;
namespace ClaudeDo.Ui.Services;
internal static class ForegroundHelper
{
private const int ASFW_ANY = -1;
[DllImport("user32.dll", SetLastError = true)]
private static extern bool AllowSetForegroundWindow(int dwProcessId);
// Grants any process the right to take foreground on next SetForegroundWindow call.
// Used before RPCs that cause a helper process (e.g. wt.exe) to spawn a new window.
public static void AllowAny()
{
if (!OperatingSystem.IsWindows()) return;
try { AllowSetForegroundWindow(ASFW_ANY); } catch { }
}
}