Hiding dock icon for MacOS

This commit is contained in:
Rukira 2026-08-25 11:38:37 +01:00
parent b7bff1a7bd
commit e873f14a7b
3 changed files with 25 additions and 3 deletions

View file

@ -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 = """
<key>LSUIElement</key>
<true/>
""".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