From 9c575a855d59fa05b8a465c11e78d2e03e655684 Mon Sep 17 00:00:00 2001 From: "dtinth-claw[bot]" <290121326+dtinth-claw[bot]@users.noreply.github.com> Date: Thu, 23 Jul 2026 13:51:24 +0700 Subject: [PATCH 1/3] Remove unused QMessageBox include from CoreAudio sound.h The include is not referenced anywhere in src/sound/coreaudio-mac/ and breaks CONFIG+=headless builds on macOS, where the widgets module is not available. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01HGdLtGxMrbExBFG3aReNAH --- src/sound/coreaudio-mac/sound.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sound/coreaudio-mac/sound.h b/src/sound/coreaudio-mac/sound.h index 9ee2796578..970c63718f 100644 --- a/src/sound/coreaudio-mac/sound.h +++ b/src/sound/coreaudio-mac/sound.h @@ -50,7 +50,6 @@ #include #include #include -#include #include "../soundbase.h" #include "../../global.h" From 2e74c057195e13ec33110d44ad383e823aee2338 Mon Sep 17 00:00:00 2001 From: "dtinth-claw[bot]" <290121326+dtinth-claw[bot]@users.noreply.github.com> Date: Thu, 23 Jul 2026 13:51:25 +0700 Subject: [PATCH 2/3] Use QCoreApplication::applicationDirPath() in Windows-only block The #ifdef _WIN32 block runs in headless builds too, but is only included when HEADLESS is not defined, so headless Windows builds fail to compile. applicationDirPath() is a static inherited from QCoreApplication, so this is behavior-neutral in GUI builds. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01HGdLtGxMrbExBFG3aReNAH --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a518c2e515..7bca23fbfb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -909,7 +909,7 @@ int main ( int argc, char** argv ) // For accessible support we need to add a plugin to qt. The plugin has to // be located in the install directory of the software by the installer. // Here, we set the path to our application path. - QDir ApplDir ( QApplication::applicationDirPath() ); + QDir ApplDir ( QCoreApplication::applicationDirPath() ); pApp->addLibraryPath ( QString ( ApplDir.absolutePath() ) ); #endif From 8a3f969c6ecb6544fe26d3bac6d561a0131fcc45 Mon Sep 17 00:00:00 2001 From: "dtinth-claw[bot]" <290121326+dtinth-claw[bot]@users.noreply.github.com> Date: Thu, 23 Jul 2026 14:48:57 +0700 Subject: [PATCH 3/3] Gate qt_set_sequence_auto_mnemonic behind HEADLESS on macOS A third headless-on-macOS gap, found once the sound.h fix let the headless build reach the link stage: main.cpp calls qt_set_sequence_auto_mnemonic() unconditionally on Q_OS_MACOS, but the symbol only resolves when QtWidgets is linked -- so a plain CONFIG+=headless build fails at link time with "symbol(s) not found for architecture arm64". Menu-accelerator mnemonics are meaningless without a GUI, so gate both the extern declaration and the call site behind !defined(HEADLESS) as well. mac/activity.h and the CActivity app-nap-prevention machinery stay unconditional for macOS -- headless servers/clients still want nap prevention, only the mnemonic bits are GUI-only. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01HGdLtGxMrbExBFG3aReNAH --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 7bca23fbfb..10f962d4be 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -66,6 +66,8 @@ #endif #if defined( Q_OS_MACOS ) # include "mac/activity.h" +#endif +#if defined( Q_OS_MACOS ) && !defined( HEADLESS ) extern void qt_set_sequence_auto_mnemonic ( bool bEnable ); #endif #include @@ -82,7 +84,7 @@ extern void qt_set_sequence_auto_mnemonic ( bool bEnable ); int main ( int argc, char** argv ) { -#if defined( Q_OS_MACOS ) +#if defined( Q_OS_MACOS ) && !defined( HEADLESS ) // Mnemonic keys are default disabled in Qt for MacOS. The following function enables them. // Qt will not show these with underline characters in the GUI on MacOS. (#1873) qt_set_sequence_auto_mnemonic ( true );