diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2de74d14..85c11936 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,6 +76,14 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Compile the macOS panel window bridge + shell: bash + run: | + for arch in arm64 x86_64; do + xcrun --sdk macosx clang++ -arch "$arch" -std=c++17 -fobjc-arc -fsyntax-only \ + -Isrc/apps -Isrc/base src/apps/desktop/panel_window_mac.mm + done + - name: Test native installer and both UI architectures run: bash tests/scripts/macos_installer_test.sh diff --git a/src/apps/desktop/panel_window_mac.mm b/src/apps/desktop/panel_window_mac.mm index 0062094f..49a9174b 100644 --- a/src/apps/desktop/panel_window_mac.mm +++ b/src/apps/desktop/panel_window_mac.mm @@ -352,14 +352,15 @@ - (void)closeNow { - (void)handleCommand:(acecode::desktop::PanelWindowCommand)command fromOrigin:(const std::string&)origin { if (_tornDown || origin != _origin) return; - __weak ACECodePanelWindowController* weakSelf = self; switch (command) { - case PanelWindowCommand::Close: + case PanelWindowCommand::Close: { // 不在脚本消息回调里拆网页视图,推迟到回调返回之后。 + __weak ACECodePanelWindowController* weakSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf closeNow]; }); break; + } case PanelWindowCommand::Focus: [self showInFront]; break;