From dcdf15946360875a27ca4818266020c42a485734 Mon Sep 17 00:00:00 2001 From: Din Tort Date: Mon, 27 Oct 2025 21:19:54 +0100 Subject: [PATCH] feat(macos): Relaunch app to fix tray icon and add Dock icon This change modifies the macOS app bundle creation script to improve the application's behavior and user experience on macOS. Previously, when Solaar was launched as a standard `.app` bundle, macOS restrictions sometimes prevented the GTK tray icon from appearing correctly. This change introduces a workaround in the wrapper script. The application now relaunches itself as a detached background process on the first launch. This new, detached process is no longer subject to the same `.app` bundle restrictions, allowing the tray icon to be created reliably. Additionally, the `LSUIElement` key in the `Info.plist` is set to `false`. This makes Solaar a regular application with an icon in the Dock, which is the standard behavior expected by most macOS users for a graphical application. --- tools/create-macos-app.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/create-macos-app.sh b/tools/create-macos-app.sh index ddb77a20..56fb85b0 100755 --- a/tools/create-macos-app.sh +++ b/tools/create-macos-app.sh @@ -31,7 +31,20 @@ WRAPPER="${MACOS_DIR}/solaar-wrapper" cat > "${WRAPPER}" </dev/null 2>&1 & + exit 0 +fi + +# Second invocation - now detached, exec solaar normally +exec "${SOLAAR_RESOLVED_PATH}" "\$@" EOF chmod +x "${WRAPPER}" @@ -78,6 +91,8 @@ cat <11.0 NSInputMonitoringUsageDescription Solaar needs to access input devices to configure and monitor your Logitech keyboards, mice, and other peripherals. + LSUIElement + EOF if [[ ${HAVE_ICON} -eq 1 ]]; then cat <<'EOF'