https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
compose-desktop
  • p

    PHondogo

    05/20/2022, 10:26 AM
    Hello! When mouse btn press on Button, move and release on the same Button it is not treated as click and Button onClick not fired. Sometime when I make mouse click it is not fired due to this behaviour (while clicking mouse has moved a little). Is this supposed to be like it is or it is a bug?
    m
    d
    • 3
    • 4
  • r

    Rob Smith

    05/20/2022, 6:00 PM
    Is there a known good workflow for integrating Mapbox or Google maps into a Compose Desktop application? Looking for a sample, or place to start. Thanks!
    k
    j
    • 3
    • 3
  • k

    Kavin Gupta

    05/21/2022, 2:06 PM
    Does anyone know what an error like this means? I think it stems from rendering a Lazy Column of composables (Textfields, text, sliders, etc.), but I haven't been able to intentionally reproduce it, nor have I been able to get any stacktraces for it yet. Any help would be appreciated
    k
    a
    • 3
    • 4
  • m

    Michael Paus

    05/22/2022, 10:19 AM
    I tried to experiment with mouse scroll events following this tutorial from JetBrains: https://github.com/JetBrains/compose-jb/blob/master/tutorials/Mouse_Events/README.md#mouse-events But when I build the project all I get is this:
    e: …/CmpMapPane.kt: (132, 55): This API is experimental and is likely to change in the future.
    How can I get rid of that and get my code compiled. I’ve added
    @OptIn(ExperimentalFoundationApi::class)
    to the composable function on which I use the pointerInput modifier but IntelliJ is only telling me
    The opt-in annotation is redundant: no matching experimental API is used.
    s
    • 2
    • 3
  • y

    Yan Pujante

    05/22/2022, 3:53 PM
    I noticed that using a
    Slider
    within a row does not work if the other elements in the row change sizes (see attached screenshot). Code that demonstrates the behavior
    fun main() = singleWindowApplication {
        var zoom by remember { mutableStateOf(1f) }
        Row {
            Text(text = "Zoom = ${zoom}")
    //        Text(text = "Hello") // using a "static" text fixes the issue
            Slider(value = zoom, valueRange = 0.25f..1.5f, onValueChange = { zoom = it })
        }
    }
    Is this an expected behavior or is this a bug that I should report somewhere?
    😕 1
    f
    x
    d
    • 4
    • 3
  • d

    David W

    05/23/2022, 5:07 AM
    Anyone come across this crash? It happens 100% of the time for one user. They've moved the enclosing folder around and tried running as admin. Error is that
    skiko-windows-x64.dll
    is missing dependencies. They're on Windows 7 but have a x64 OS.
    d
    m
    +2
    • 5
    • 26
  • j

    jw

    05/23/2022, 7:58 PM
    why are some alphas pushed to maven central and others not?
    🤔 3
    ➕ 1
    i
    • 2
    • 3
  • k

    Kavin Gupta

    05/23/2022, 11:07 PM
    Does anyone have any information on autoupdaters w/ CfD? I'm fairly new to the process, but I'm trying to add autoupdating functionality to my application, autodownloading new releases. Would I have to create a main JAR file that would replace the code, or something else...? It's a relatively small app so I think replacing everything may be fine
    ➕ 2
    x
    s
    +2
    • 5
    • 8
  • d

    Dragos Rachieru

    05/24/2022, 9:20 AM
    Hello, I want to do some 3d drawing in my app and I don't know what to use. I tried using https://jmonkeyengine.org/ but I couldn't make it work. I saw the example with
    lwjgl
    , but I think it's too complex for me, I want to show a
    3D
    view only in a preview screen. I tried using
    vtk
    with java wrappers, but I can't make that work either(on my machine at least). I was thinking about using https://github.com/google/filament but I don't know if it is supported, saw some threads from @romainguy about this, but haven't found an answer
    r
    a
    • 3
    • 3
  • m

    Michael Paus

    05/24/2022, 12:50 PM
    I experimented a bit with mouse-wheel scrolling and I am wondering why it is so different from pre-existing solutions (e.g. JavaFX). 1. Why is the sign of scrollDelta.y just the opposite of the one from JavaFX. 2. Why is the value so different? A single mouse-wheel tick is +-0.1 for Compose but +-1.0 for JavaFX. 3. What is the meaning of the scrollDelta offset values? 4. Is there a way to distinguish text scrolling from pixel scrolling? 5. There does not seem to be a possibility to distinguish different event sources. E.g. it is important to distinguish between a scroll event from a mouse-wheel or an attached trackpad because you might want to perform a different action depending on the source. 6. Is it possible that not all the associated API is accessible from commonMain?
    k
    • 2
    • 3
  • d

    Dragos Rachieru

    05/25/2022, 6:15 AM
    Does anyone know how I can make my compose app handle URIs? I want deeplinks to open my app and get the query parameters from it I want my browser to open my app for links like
    my-app://...
    ➕ 2
    👀 4
    s
    s
    t
    • 4
    • 8
  • s

    spierce7

    05/25/2022, 5:23 PM
    Hey - I have a JVM desktop compose application, that is interacting with a kotlin native executable. Right now the Kotlin native is outputting json to stdio, and the jvm desktop app is watching the stdio and reading it in. The lag that i’m seeing with this method is several hundred millis surprisingly. Is there another communication method that you might recommend that would be faster?
    ➖ 1
    z
    e
    +4
    • 7
    • 23
  • g

    Guilherme Delgado

    05/26/2022, 6:29 PM
    Inside
    "src/jvmMain/resources"
    I’ve my resources. If I run
    ./gradlew run
    the app launches and I can use them, example:
    playSound(File("src/jvmMain/resources/sound.wav"))
    . But when I create a distribution or a package those resources aren’t included. I can see them inside
    build/processedResources
    but not in
    /build/compose/binaries/main/app/MyApp.app/Contents/app/resources
    . I’ve tried this:
    with(project.file("src/jvmMain/resources")) {
        macOS { iconFile.set(resolve("icon.icns")) }
        linux { iconFile.set(resolve("icon.png")) }
        windows { iconFile.set(resolve("icon.ico")) }
        appResourcesRootDir.set(project.layout.projectDirectory.dir(this.path)) //<<<<<<<<<<<<<
    }
    But with no luck, still can’t “find them”. Funny thing, the icons (
    iconFile
    ) are found and used 🤷‍♂️ Any hint? Thanks. I was looking into this docs.
    m
    • 2
    • 4
  • j

    Josh Rose

    05/27/2022, 6:55 PM
    Are there any Kotlin/Java libraries similar to Pynput? I've put together a simple shortkey program with a GUI written in Python, but I would like to recreate it with Kotlin and Compose.
    m
    • 2
    • 4
  • l

    Luis Alonso Ato Neyra

    05/27/2022, 7:52 PM
    Which database is recommend to use in a compose-desktop proy?
    a
    t
    d
    • 4
    • 4
  • x

    xxfast

    05/29/2022, 2:46 AM
    Anyone has an implementation for
    ExposedDropdownMenuBox
    for desktop? looks like
    compose-jb@1.1.1
    only has this for
    androidMain
    https://github.com/JetBrains/compose-jb/issues/1673
    l
    • 2
    • 1
  • m

    miguelsesma

    05/30/2022, 8:13 AM
    How can I run the
    VideoPlyer
    demo in a macbook M1? Even having VLC installed I get this error:
    dlopen(/Applications/VLC.app/Contents/MacOS/lib/libvlccore.dylib, 0x0009): tried: '/Applications/VLC.app/Contents/MacOS/lib/libvlccore.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
    👀 1
    s
    • 2
    • 10
  • c

    Cody Mikol

    05/30/2022, 5:56 PM
    Is there a way to handle when a window is unfocused?
    z
    • 2
    • 5
  • l

    lazt omen

    05/30/2022, 6:10 PM
    How can i make function with a different implementation on windows than in linux. Is this the use case for expect/atual?
    a
    t
    • 3
    • 4
  • d

    dallas

    05/30/2022, 11:13 PM
    Is it possible to draw a Composable to e.g. an
    java.awt.Image
    so I can save it as a PNG?
    t
    • 2
    • 5
  • x

    xxfast

    05/31/2022, 1:00 AM
    is androidx.compose already multiplatform? was surprised to see
    commonMain
    here
    j
    a
    +2
    • 5
    • 15
  • k

    Kirill Grouchnikov

    05/31/2022, 1:58 PM
    Our plans regarding 1.1.2/1.2 are changed, and scope of it will be revised.
    @Igor Demin - is this something that you can comment on in a bit more detail?
    👀 5
    i
    a
    • 3
    • 3
  • s

    samuel

    06/01/2022, 11:49 AM
    Hello, i’ve been seeing more and more crashes on Mac OS when i have my application running idle (open but not actively being used). The error is
    Font transform has NaN position
    . Before i look into filing a bug report, has anyone experienced this?
    t
    • 2
    • 3
  • c

    Cody Mikol

    06/02/2022, 2:19 AM
    Is there currently any way to detect if an element is within the visible viewport?
    g
    • 2
    • 1
  • a

    Aaron Yoder

    06/02/2022, 10:19 AM
    Is there a way to fix this? I've tried clipping, not clipping, nothing seems to work. The background color is leaking out the corners of the border. Also tried clipToBounds(). Using version 1.1.1.
    Box(
        modifier = Modifier.height(48.dp)
            .fillMaxWidth()
            .background(color = backgroundColor, shape = RoundedCornerShape(4.dp))
            .border(border = if(selected) BorderStroke(4.dp, Color.Black) else BorderStroke(0.dp, Color.Transparent), shape = RoundedCornerShape(4.dp))
            .clip(RoundedCornerShape(4.dp))
            .selectable(selected = selected, onClick = { onClick.invoke(index) }),
        contentAlignment = Alignment.Center
    )
    a
    d
    +2
    • 5
    • 24
  • a

    Alexander Maryanovsky

    06/02/2022, 12:38 PM
    So, now that we’re using compose on the desktop (JVM), we have the usual Java problem of first-time class loading taking a long time, which looks bad in a desktop app. Is there a good solution for this? So far my best is to load all the classes given by Guava’s
    ClassPath.allClasses
    , but that seems a bit much.
    a
    m
    m
    • 4
    • 7
  • m

    miguelsesma

    06/02/2022, 2:24 PM
    As part of a spike to study the viability of using Compose Desktop for an IOT project, I have just managed to run a compose window with an embedded CEF Chromium browser in Ubuntu arm64. Next step is getting rid of the window manager and if possible of X11. I have no idea of how to start doing that. Any guidance / advice /sample project would be welcomed. :D
    :not-kotlin: 1
    s
    a
    m
    • 4
    • 17
  • d

    Dragos Rachieru

    06/02/2022, 4:30 PM
    Hello, does anyone know why I get this error when I try building my project? The imports work in the editor and I can run the code when using compose for desktop, but android fails to build:
    i
    l
    • 3
    • 19
  • s

    spierce7

    06/03/2022, 1:30 AM
    I used Compose JVM to create an image generation server, which is significantly faster than HTML Image generation methods I’ve found for servers. I wasn’t able to get compose running on Alpine Linux via Docker. The JVM was crashing. I was however able to get it running on Ubuntu Linux via docker just by adding the packages
    libgl1-mesa-glx
    and
    libfontconfig
    . Image generation is slower on a server than a laptop, which is a little unexpected, but I suspect it’s because all rendering is being done with a CPU, and no GPU. As things stand I’m generating simple 4k images in ~300 - 500 millis.
    :party-parrot: 1
    m
    • 2
    • 7
  • m

    miguelsesma

    06/03/2022, 10:36 AM
    I'm trying to place some compose UI on top of a JCEF browser shown on a
    SwingPanel
    . Unfortunately it does not work because as stated in the documentation, SwingPanel is on top.
    The Swing component is placed on top of the Compose layer (that means that Compose content can't overlap or clip it).
    Any ideas of how to circumvent this limitation?
    ➕ 2
    d
    • 2
    • 6
Powered by Linen
Title
m

miguelsesma

06/03/2022, 10:36 AM
I'm trying to place some compose UI on top of a JCEF browser shown on a
SwingPanel
. Unfortunately it does not work because as stated in the documentation, SwingPanel is on top.
The Swing component is placed on top of the Compose layer (that means that Compose content can't overlap or clip it).
Any ideas of how to circumvent this limitation?
➕ 2
Following this idea https://github.com/JetBrains/compose-jb/issues/1521 I'v able to add a composable over a SwingPanel, but I cannot make the background transparent because of this https://github.com/JetBrains/compose-jb/issues/147
d

David W

06/03/2022, 7:02 PM
This sums it up well:
They didn't fix the issue of rendering compose over a SwingPanel. They just made a semi informative page about it and said literally "or stop using the SwingPanel and still try to implement the missing component, thereby contributing to the development of technology and making life easier for other developers.".
haven't seen any indication that they plan on trying to fix it
So there's no good way to display a web view in Compose at all
I've been very jealous of an acquaintance writing a rival desktop application (in Rust) to my Compose one because he can use Windows's WebView2 whereas I'm bundling the full 200MB JCEF with mine and it randomly stops working.
Of course I could write JNI bindings to try and do the same, but the amount of effort that'd take that I could put into other app improvements means it's not happening.
View count: 27