diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 9e78e71..df26346 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -70,7 +70,7 @@ compose.desktop { application { mainClass = "com.rukira.wowbackup.MainKt" - jvmArgs("-Dapple.awt.enableTemplateImages=true") + jvmArgs("-Dapple.awt.enableTemplateImages=true", "-Dapple.awt.UIElement=true") nativeDistributions { targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) @@ -82,6 +82,12 @@ compose.desktop { macOS { bundleID = "com.rukira.wowbackup" iconFile.set(project.file("src/jvmMain/resources/icon.icns")) + infoPlist { + extraKeysRawXml = """ + LSUIElement + + """.trimIndent() + } } windows { diff --git a/composeApp/src/jvmMain/kotlin/com/rukira/wowbackup/main.kt b/composeApp/src/jvmMain/kotlin/com/rukira/wowbackup/main.kt index a9e0d8b..aee168b 100644 --- a/composeApp/src/jvmMain/kotlin/com/rukira/wowbackup/main.kt +++ b/composeApp/src/jvmMain/kotlin/com/rukira/wowbackup/main.kt @@ -28,6 +28,9 @@ import java.awt.GraphicsEnvironment private val logger = KotlinLogging.logger {} fun main() { + if (Platform.current == OS.Mac) { + System.setProperty("apple.awt.UIElement", "true") + } LoggingSetup.init() logger.info { "WoW Backup starting" } diff --git a/docs/plans/feature-1-system-tray.md b/docs/plans/feature-1-system-tray.md index 699456f..826321a 100644 --- a/docs/plans/feature-1-system-tray.md +++ b/docs/plans/feature-1-system-tray.md @@ -84,18 +84,31 @@ Strip all template code. Route to placeholder screens based on `currentScreen`: ### Step 5: Auto-show config if not configured In `main.kt`, on startup check `ConfigManager.isConfigured`. If false, set `currentScreen = Screen.CONFIG` and `isWindowVisible = true`. -### Step 6: macOS JVM args +### Step 6: macOS JVM args and Dock hiding (LSUIElement) **Files to modify:** - `composeApp/build.gradle.kts` — add to desktop application config: ```kotlin compose.desktop { application { - jvmArgs("-Dapple.awt.enableTemplateImages=true") + jvmArgs("-Dapple.awt.enableTemplateImages=true", "-Dapple.awt.UIElement=true") + + nativeDistributions { + macOS { + infoPlist { + extraKeysRawXml = """ + LSUIElement + + """.trimIndent() + } + } + } } } ``` +Also set `System.setProperty("apple.awt.UIElement", "true")` in `main.kt` for macOS so that the dock icon is suppressed during development runs. + ## Verification 1. `./gradlew composeApp:run` — app launches with tray icon visible 2. Tray icon shows context menu with Status, Settings, Quit