From b52e067d5089de3d2938c1dc25f6575ffe1da7bc Mon Sep 17 00:00:00 2001 From: landaiqing Date: Tue, 8 Jul 2025 17:36:45 +0800 Subject: [PATCH] :apple: Fix build issues --- internal/services/hotkey_service_darwin.go | 7 +++++++ internal/services/startup_darwin.go | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/services/hotkey_service_darwin.go b/internal/services/hotkey_service_darwin.go index b68b42c..74f5a31 100644 --- a/internal/services/hotkey_service_darwin.go +++ b/internal/services/hotkey_service_darwin.go @@ -283,6 +283,13 @@ func (hs *HotkeyService) IsRegistered() bool { return hs.isRegistered.Load() } +// ToggleWindow 切换窗口显示状态 +func (hs *HotkeyService) ToggleWindow() { + if hs.app != nil { + hs.app.EmitEvent("hotkey:toggle-window", nil) + } +} + // OnShutdown 关闭热键服务 func (hs *HotkeyService) OnShutdown() error { return hs.UnregisterHotkey() diff --git a/internal/services/startup_darwin.go b/internal/services/startup_darwin.go index 8d6c254..abf3adf 100644 --- a/internal/services/startup_darwin.go +++ b/internal/services/startup_darwin.go @@ -9,7 +9,6 @@ import ( "path/filepath" "strings" - "github.com/wailsapp/wails/v3/pkg/application" "github.com/wailsapp/wails/v3/pkg/mac" "github.com/wailsapp/wails/v3/pkg/services/log" )