Alexander Maryanovsky
03/10/2025, 11:48 AMAlexander Maryanovsky
03/10/2025, 11:56 AMColton Idle
03/10/2025, 2:24 PMAlexander Maryanovsky
03/10/2025, 2:28 PMAlexander Maryanovsky
03/10/2025, 2:29 PM-Dapple.awt.UIElement=true
Colton Idle
03/10/2025, 2:59 PMAlexander Maryanovsky
03/10/2025, 3:01 PMColton Idle
03/10/2025, 5:37 PMtasks.named<JavaExec>("run") {
if (org.gradle.internal.os.OperatingSystem.current().isMacOsX) {
jvmArgs = listOf("-Dapple.awt.UIElement=true")
}
}
this also maybe seems to work?
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "test"
packageVersion = "1.0.0"
macOS {
macOS {
infoPlist {
extraKeysRawXml = """
<key>LSUIElement</key>
<true/>
""".trimIndent()
}
}
}
}
romainguy
03/10/2025, 8:17 PM-D
argument. It only sets a system property so it'll be a no-op everywhere else.Colton Idle
03/10/2025, 10:07 PMcompose.desktop {
application {
jvmArgs += listOf("-Dapple.awt.UIElement=true")
It doesn't seem to work since I still see the java icon in the switcher... but ill try to investigate moreromainguy
03/10/2025, 10:10 PMromainguy
03/10/2025, 10:12 PMAlexander Maryanovsky
03/10/2025, 10:13 PMrun
task)Alexander Maryanovsky
03/10/2025, 10:13 PMjvmArgs += "-Dapple.awt.UIElement=true"
Colton Idle
03/10/2025, 10:14 PMmacOS {
infoPlist {
extraKeysRawXml = """
<key>LSUIElement</key>
<true/>
""".trimIndent()
}
}
Alexander Maryanovsky
03/10/2025, 10:14 PMlistOf
too.Alexander Maryanovsky
03/10/2025, 10:15 PMplusAssign
overloadColton Idle
03/10/2025, 10:15 PMAlexander Maryanovsky
03/10/2025, 10:16 PM// Prevents the Java icon from being shown in the macOS dock when running tests
tasks.withType<Test>().configureEach {
systemProperty("apple.awt.UIElement", "true")
}
which also worksColton Idle
03/10/2025, 10:16 PMTask with name 'run' not found in project ':composeApp'.
Colton Idle
03/10/2025, 10:16 PMColton Idle
03/10/2025, 10:16 PMromainguy
03/10/2025, 10:17 PM<string>true</string>
Alexander Maryanovsky
03/10/2025, 10:17 PMmain
to verify that it works at all.Alexander Maryanovsky
03/10/2025, 10:18 PMAlexander Maryanovsky
03/10/2025, 10:18 PMromainguy
03/10/2025, 10:18 PMAlexander Maryanovsky
03/10/2025, 10:19 PM-Dā¦
thereColton Idle
03/10/2025, 10:19 PMColton Idle
03/10/2025, 10:19 PMromainguy
03/10/2025, 10:20 PMAlexander Maryanovsky
03/10/2025, 10:20 PMColton Idle
03/10/2025, 10:20 PMromainguy
03/10/2025, 10:20 PMAlexander Maryanovsky
03/10/2025, 10:22 PMTask with name ārunā not found in project ā:composeAppā.
Colton Idle
03/10/2025, 10:24 PMAlexander Maryanovsky
03/10/2025, 10:24 PMcompose.desktop {
application {
jvmArgs += "-Dapple.awt.UIElement=true"
...
}
}
and then use the run
task.Colton Idle
03/10/2025, 10:24 PMColton Idle
03/10/2025, 10:25 PMColton Idle
03/10/2025, 10:26 PMAlexander Maryanovsky
03/10/2025, 10:26 PMcompose.desktop {
application {
nativeDistributions {
...
macOS {
jvmArgs += "-Dapple.awt.application.appearance=system"
}
}
}
}
romainguy
03/10/2025, 10:27 PMmain
, put it as the first thing and it should work just fineromainguy
03/10/2025, 10:28 PMAlexander Maryanovsky
03/10/2025, 10:28 PMI can also confirm that I can get my āsettingsā window to show when I click it from the menu bar. So it seems to work as I wanted!Ah, so it does open a window, it just doesnāt bring it to the front, so it was behind the IDE for me, and I didnāt see it.
Colton Idle
03/10/2025, 10:28 PMColton Idle
03/10/2025, 10:28 PMAh, so it does open a window, it just doesnāt bring it to the front, so it was behind the IDE for me, and I didnāt see it.Ah. I do indeed have that "bring to front" code you helped me with a few weeks ago.
romainguy
03/10/2025, 10:28 PMColton Idle
03/10/2025, 10:28 PMAlexander Maryanovsky
03/10/2025, 10:29 PMColton Idle
03/10/2025, 10:32 PM@OptIn(ExperimentalResourceApi::class)
fun main() = application {
System.setProperty("apple.awt.UIElement", "true")
did not seem to workromainguy
03/10/2025, 10:32 PMAlexander Maryanovsky
03/10/2025, 10:39 PMfun main() = application {
System.setProperty(āapple.awt.UIElementā, ātrueā)Thatās waaay after AWT initialization
Alexander Maryanovsky
03/10/2025, 10:40 PMfun main() {
System...
application {
..
}
}
Colton Idle
03/10/2025, 10:46 PMcompose.desktop {
application {
jvmArgs += listOf("-Dapple.awt.UIElement=true")
^worked
compose.desktop {
application {
nativeDistributions {
...
macOS {
jvmArgs.add("-Dapple.awt.UIElement=true")
}
^worked
macOS {
infoPlist {
extraKeysRawXml = """
<key>LSUIElement</key>
<true/> and tried <string>true</true>
""".trimIndent()
}
}
^did not work
@OptIn(ExperimentalResourceApi::class)
fun main() {
System.setProperty("apple.awt.UIElement", "true")
application {
^worked
tasks.named<JavaExec>("run") {
jvmArgs = listOf("-Dapple.awt.UIElement=true")
}
^did not work, but only because it can't find the run task?Colton Idle
03/10/2025, 10:46 PMColton Idle
03/10/2025, 10:46 PMAlexander Maryanovsky
03/11/2025, 7:32 AMColton Idle
03/11/2025, 1:37 PMMarcin Wisniowski
03/13/2025, 11:56 AM