https://kotlinlang.org logo
Join SlackCommunities
Powered by
# compose-desktop
  • f

    Fergus Hewson

    04/14/2025, 9:24 PM
    Hey, is there anyway to set packaging options for Desktop, like with android? I want to cleanup proguard output.
    c
    • 2
    • 2
  • l

    LazyIonEs

    04/15/2025, 11:55 AM
    I want to know, is there a way to set the background color of the system decoration without setting undecorated to true?
    Copy code
    fun main() = application {
        Window(
            onCloseRequest = ::exitApplication, title = "Test", icon = painterResource(Res.drawable.icon)
        ) {
            App()
        }
    }
    šŸ‘€ 1
    a
    u
    • 3
    • 10
  • s

    Slackbot

    04/18/2025, 9:03 AM
    This message was deleted.
    Copy of Android Practical.docx
    not kotlin but kotlin colored 3
    a
    • 2
    • 1
  • d

    Dmitriy Tarasevich

    04/18/2025, 6:26 PM
    šŸ‘‹ I just took some time to get compose hot reload into my 9-5 project since 2.1.20 enabled configuration caching to work with it, unfortunately it seems like within the past few versions a new task has been introduced that looks like
    syncdesktopMainApplicationClasses
    which takes roughly 1 minute to compile and spits out logs like the following
    Copy code
    file '/Users/dmitriytarasevich/.gradle/caches/8.11/transforms/798854b096b6a05b98708be9554307cf/transformed/feature-streaming-pip-jvm-0.7.0/META-INF/MANIFEST.MF' will be copied to '/Users/dmitriytarasevich/dev/fbg-kmp-sdk-alternate/desktop/app/build/run/desktopMain/classes/META-INF/MANIFEST.MF', overwriting file '/Users/dmitriytarasevich/.gradle/caches/8.11/transforms/6431cd6a7bfda5fd687ab9108f3850f8/transformed/foobar-sdk-jvm-0.7.0/META-INF/MANIFEST.MF', which has already been copied there.
    for each module we have in the project, seeing as we have around 100 modules this steps takes quite a bit of time. Due to this issue, the inclusion of compose hot reload actually makes incremental builds substantially slower. Please let me know if there is any additional information you need.
    f
    s
    • 3
    • 17
  • m

    Michael Paus

    04/20/2025, 7:58 AM
    According to https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html Compose Desktop supports ARM64 for both Linux and Windows. I have two question associated with that: 1. Can anybody confirm that this works reliably in general. Both at build and execution time? 2. Does building work with the experimental ARM GitHub runners for Linux/Windows for public repositories? See: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-gith[…]-repositories I neither have an ARM box for Linux nor for Windows, so I can’t test it myself but if that works reliably I’d try to support these additional platforms with my software as soon as these runners become available for private repositories too.
    a
    j
    • 3
    • 2
  • w

    William

    04/21/2025, 5:58 PM
    Anyone face this issue before? I'm trying to make an api call to my locally hosted server with a self-signed cert... but i get this error.. it works fine in
    compose-web
    locally..
    sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    a
    • 2
    • 2
  • m

    martmists

    04/21/2025, 10:58 PM
    I'm trying to use an unmodifiable TextField to display the contents of a ByteArray, but it seems compose takes about half a minute to calculate the layouting of the text, instead of just having it be the width of the TextField and scrolling all the way down. How can I make this faster?
    e
    r
    • 3
    • 38
  • s

    Sudarshan

    04/24/2025, 6:20 PM
    Now my window feels completely lifeless—no animations, no transitions, nothing. It's even hiding the navigation bar.
    k
    • 2
    • 11
  • g

    gbaldeck

    04/25/2025, 5:01 AM
    Hi all! Does anyone know what may be causing the below error? I have spent quite a bit of time trying to fix it with no luck.
    Copy code
    BookListScreenRootTest[desktop] > bookListScreenRoot_displaysSearchBar[desktop] FAILED                                                                                                                                                                                                                                                   
        java.lang.NoSuchMethodError at ComposeUiTest.skikoMain.kt:221
    a
    • 2
    • 23
  • g

    gbaldeck

    04/25/2025, 5:02 AM
    Here's more context for my project.
    build.gradle.ktsBookListScreenRootTest.ktlibs.versions.toml
  • c

    Chethan N

    04/28/2025, 12:19 PM
    Hi all, does compose desktop support UI automation? Was trying to use windows inspect accessibility tool. It is not able to find the UI elements rendered (It is able to get only the window level buttons like minimise, close etc)
    a
    • 2
    • 2
  • y

    Yassine Abou

    04/28/2025, 11:42 PM
    Hi everyone, I’m struggling with a serialization error in my desktop app. The app works perfectly in debug mode, but when I build it for release, I get this error:
    āš ļø
    Serializer for class 'ChatCompletionRequest' is not found. Please
    ensure the class is marked as '@Serializable' and the serialization
    compiler plugin is applied.
    I’ve already marked the
    ChatCompletionRequest
    class as
    @Serializable
    . I also followed advice from two StackOverflow links about similar issues (linked below), including updating Proguard rules to keep serializers. Unfortunately, nothing has fixed the problem so far. Here are the StackOverflow threads I referenced: 1. Serializer for class not found 2. Proguard/R8 serialization issue The full code is in my GitHub repository: https://github.com/yassineAbou/LLMS
    w
    • 2
    • 6
  • a

    Alex Styl

    04/29/2025, 12:43 PM
    I am building Apple Silicon + Intel version of my app in parallel But right now they both output their respective dmg to the same file, which is problematic Any way to add a suffix to each one somehow? I tried changing the
    packageName
    and it does change the dmg file, but it also changes the app name inside of the dmg
    a
    m
    • 3
    • 16
  • j

    Jacob Ras

    04/29/2025, 1:19 PM
    Is there any way to configure the Windows start menu name for a CMP app? For Mac OS there's the
    dockName
    that can be set, but what about Windows and Linux?
    a
    • 2
    • 10
  • s

    Stefan Oltmann

    04/29/2025, 2:21 PM
    Does someone publisher their Compose Multiplatform macOS app (DMG/PKG) directly to the Apple App Store for macOS? I tried this some time ago and it didn't work as Apple did not expect the binary in TestFlight. I wonder if it works now.
    e
    t
    m
    • 4
    • 13
  • a

    Alex Styl

    04/29/2025, 7:49 PM
    was anyone able to package a universal mac os binary?
    e
    • 2
    • 4
  • j

    Josh Brown

    05/01/2025, 12:09 PM
    I have an application that runs in multiple processes, and uses
    ProcessBuilder
    to start them. When I use
    :run
    this works fine, but if I use
    :runDistributable
    the
    java.home
    directory doesn't have a
    /bin/java
    to execute. Based on https://stackoverflow.com/questions/71924648/jpackage-for-only-one-application, it seems like I need to tweak how
    jpackage
    is configuring
    jlink
    , but I'm not sure where to do that in the
    build.gradle.kts
    .
    • 1
    • 1
  • a

    Alex Styl

    05/01/2025, 5:48 PM
    how long does it take to distribute your desktop apps? It takes me about 15~20 minutes to distribute Intel + Apple silicon versions of my app on my M3 that includes 2x(build w proguard + wait for notarize + upload to github)
    c
    • 2
    • 3
  • m

    martmists

    05/02/2025, 7:59 AM
    I've added
    Copy code
    System.setProperty("compose.swing.render.on.graphics", "true")
    System.setProperty("compose.interop.blending", "true")
    but for some reason I still can't draw over top of a SwingPanel, am I missing something? For context, I'm using cameraK which displays as SwingPanel+ImagePanel (https://github.com/Kashif-E/CameraK/blob/main/cameraK/src/desktopMain/kotlin/com/kashif/cameraK/ui/CameraPreview.desktop.kt#L62) and I have my code more or less like this:
    Copy code
    Box {
        CameraPreview(...)
        Text("Test")
        Canvas {  /* Draw overlays here, also tried Modifier.drawWithContent already */ }
    }
    a
    i
    • 3
    • 2
  • u

    אליהו הדה

    05/05/2025, 1:43 PM
    Hi everyone, In a library, I need a reliable way, at runtime, to know whether the host application was started via classes on disk (
    gradlew run
    ) or via packaged JAR (
    gradlew runDistributable
    ). Does the Compose plugin expose any flag or API that I can check from within the library? Thanks!
    f
    p
    • 3
    • 3
  • l

    louiscad

    05/05/2025, 9:55 PM
    Hello, is it expected that
    ImageComposeScene
    renders one frame late, or just renders wrong? I am using this composable where I call
    render
    repeatedly on the same
    ImageComposeScene
    , but with ever increasing
    nanoTime
    values, and I only get the correct render if I call
    render
    a second time, which is quite of a dirty workaround.
    Copy code
    @Composable
    fun JustFrameNumberComposable() {
        val frameNumber by produceState(0L) {
            while (true) withFrameMillis { frameTimeMillis ->
                value = frameTimeMillis * 60L / 1000L
            }
        }
        Text("Frame number: $frameNumber")
    }
    a
    • 2
    • 12
  • n

    Niklas WintrƩn

    05/06/2025, 12:37 PM
    I am not up to date with all that has been written here, so excuse me if I'm asking something that's been covered šŸ˜› TL;DR - Mouse events lost if inside window bounds on startup. I have a KMP/CMP targeting all platforms - in my desktop version (Debug at least) if I enter the window of my app during startup all of the following mouse events gets lost. This is fixed by using the Hot Reload Tooling window's "Clean Composition", or just restarting the app and making sure I don't have my mouse where the window will appear. Has anyone else seen this issue? I don't remember having the issue before enabling Hot Reload, so it might be a baddie. compose: 1.8.0 compose plugin: 1.8.0-rc01 kotlin: 2.1.20 (plugins [kmp, jvm, compose] same version) compose hot reload plugin: 1.0.0-alpha09
    a
    • 2
    • 2
  • j

    Jeff Lockhart

    05/08/2025, 3:37 AM
    Is there a way to configure Compose Desktop to set a system environment variable? Specifically the
    LD_LIBRARY_PATH
    environment variable on Linux.
    p
    m
    • 3
    • 5
  • f

    ferdialif02

    05/08/2025, 4:44 AM
    Is there a way to load wkwebview on compose desktop if we are on mac platform
  • d

    dleuck

    05/08/2025, 12:11 PM
    I'm working on autocomplete for a Compose for Desktop mini-IDE using a DSL I designed. When a DOT (.) is typed after a property or class it is supposed to pop up a context menu with the members (properties and functions) in the menu so they can be easily selected with the keyboard or mouse. You see this feature in IDEs like IntelliJ IDEA, Xcode and VS Code. Thus far I haven't been able to get the popup (context) menu to appear with it's upper left hand corner touching the DOT. The menu works, but it is never in the correct position. The coordinates are aways off. The menu displays farther down (down and away) from the DOT if your DOT is typed toward the viewport's bottom, and up (over) the DOT if you type it toward the viewport's top. Using X / Y coordinates with offsets doesn't work and neither does using rows and columns. Margins are built into the calculations. All the units are correct. I've been working on this along with Claude and other AI's. Nobody can figure it out. There seems to be a serious bug or bugs in one of the (outside) supporting components, either in the coordinate calculations, units or something adjacent to them. Has anyone encountered this problem?
    a
    k
    • 3
    • 2
  • s

    Sean Proctor

    05/08/2025, 12:21 PM
    Does anyone have an idea on how to add context menus to part of an
    AnnotatedString
    ? When a link is clicked, I want to open the associated context menu. Currently, I'm using a
    DropdownMenu
    that opens in an arbitrary location, which isn't great.
    a
    • 2
    • 7
  • m

    martmists

    05/08/2025, 3:32 PM
    How do I fix error popups being empty?
    k
    z
    a
    • 4
    • 9
  • s

    saba

    05/08/2025, 11:13 PM
    Hi all, I can’t seem to figure out how to get rid of this gradient banding (see screenshot). I’m using
    Brush.verticalGradient
    and driving myself crazy trying to figure this out. Anyone have any ideas?
    r
    d
    • 3
    • 4
  • l

    louiscad

    05/10/2025, 12:34 AM
    Hello, I'm getting this surprising
    ArrayIndexOutOfBoundsException
    when
    ImageComposeScene.use { … }
    exits. Could it be caused by Compose Hot Reload, or is it something different? This is with Compose Hot Reload 1.0.0-alpha09 and Compose 1.8.0-rc01 on macOS.
    Copy code
    Index -331 out of bounds for length 640
    java.lang.ArrayIndexOutOfBoundsException: Index -331 out of bounds for length 640
    	at androidx.compose.runtime.SlotWriter.moveSlotGapTo(SlotTable.kt:4174)
    	at androidx.compose.runtime.SlotWriter.removeSlots(SlotTable.kt:2904)
    	at androidx.compose.runtime.SlotWriter.removeGroup(SlotTable.kt:2021)
    	at androidx.compose.runtime.ComposerKt.removeCurrentGroup(Composer.kt:4337)
    	at androidx.compose.runtime.CompositionImpl.dispose(Composition.kt:840)
    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.disposeCurrentNodes(SubcomposeLayout.kt:638)
    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.onRelease(SubcomposeLayout.kt:450)
    	at androidx.compose.ui.node.LayoutNode.onRelease(LayoutNode.kt:1428)
    	at androidx.compose.runtime.internal.RememberEventDispatcher.dispatchRememberObservers(RememberEventDispatcher.kt:163)
    	at androidx.compose.runtime.CompositionImpl.dispose(Composition.kt:843)
    	at androidx.compose.ui.scene.BaseComposeScene.close(BaseComposeScene.skiko.kt:128)
    	at androidx.compose.ui.scene.CanvasLayersComposeSceneImpl.close(CanvasLayersComposeScene.skiko.kt:194)
    	at androidx.compose.ui.ImageComposeScene.close(ImageComposeScene.skiko.kt:178)
    s
    • 2
    • 30
  • r

    Ruckus

    05/12/2025, 5:02 PM
    I have an existing desktop utility app that uses JavaFX for the UI. I would like to try converting it over to compose to see if it's a good fit. I did that several years ago with another app, and I remember it being rather simple, but it appears things have changed significantly since then. I'm not interested in multiplatform support as this will never run on anything other than the desktop, but all the documentation seems to be either for Android alone or for mutliplatform. Is there documentation somewhere I'm missing on how to do this? I swear there used to be a page about how to add compose-desktop to an existing app, but I'm having trouble finding it. There isn't even a template anymore for desktop only, which I'm almost certain there used to be.
    šŸ‘ 1
    r
    • 2
    • 1