From 82408b8d7fa0b274f1b4d7b2cebfbaa753b1b7e7 Mon Sep 17 00:00:00 2001 From: Christine Yan Date: Tue, 5 May 2026 15:54:53 -0400 Subject: [PATCH] fix: bring existing Canvas window to front on tray menu click Previously, clicking Canvas in the tray menu when the window was already open did nothing because Activate() was only called when creating a new window. Move Activate() outside the creation guard so it always runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/OpenClaw.Tray.WinUI/Services/NodeService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenClaw.Tray.WinUI/Services/NodeService.cs b/src/OpenClaw.Tray.WinUI/Services/NodeService.cs index e13f35b..52f23e8 100644 --- a/src/OpenClaw.Tray.WinUI/Services/NodeService.cs +++ b/src/OpenClaw.Tray.WinUI/Services/NodeService.cs @@ -1018,8 +1018,8 @@ public sealed class NodeService : IDisposable { _canvasWindow = new CanvasWindow(); _canvasWindow.SetTrustedGatewayOrigin(GatewayUrl, _token); - _canvasWindow.Activate(); } + _canvasWindow?.Activate(); } // Mutable context shared with GatewayActionTransport. SessionKey is updated