https://kotlinlang.org logo
Docs
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
  • c

    Casey Brooks

    01/14/2021, 5:02 PM
    Is it possible to detect simple mouse up/down events? I’m wanting to implement a kind of arbitrary drag-and-drop across a window. Items are being positioned globally within a
    Box
    using
    pointerMoveFilter
    , but I need to detect down events to focus a single item, and up to drop. However, it seems like using
    Modifier.pointerInput { handlePointerInput { ... } }
    can detect up/down events, but move events are handled by the child relative to the child, and the parent
    Box
    never receives those move events until I drop the child
    i
    • 2
    • 4
  • t

    theapache64

    01/15/2021, 3:45 AM
    🛣️ Do we have any navigation library available for compose desktop? (like Jetpack Navigation)
    s
    • 2
    • 1
  • e

    eekboom

    01/15/2021, 12:17 PM
    TextField missing basic behavior? I might well be missing something myself, because I just started out trying compose-dekstop. I tried the most simple text field:
    var text by remember { mutableStateOf("") }
        TextField(
            value = text,
            onValueChange = { text = it }
        )
    Things that don't work: DEL key, Pos1 and End keys, text selection using Shift-Left/Right, navigating by word using Ctrl-Left/Right Using latest Kotlin 1.4.21 and org.jetbrains.compose version 0.3.0-build140
    j
    o
    • 3
    • 6
  • a

    Animesh Sahu

    01/15/2021, 2:45 PM
    Is there a glitch with
    FocusRequester.requestFocus()
    ? Seems like that doesn't work on a
    TextField
    with
    Modifier.focusModifier().focusRequester(requester)
    :blob-thinking-upside-down:
    s
    c
    • 3
    • 8
  • d

    Didier Villevalois

    01/16/2021, 10:19 AM
    Hi everyone! When I am creating a compose-desktop project through the New project wizard of IntelliJ IDEA, I am missing Compose's sources and documentation artifacts. Is there a way to fix this ?
    t
    j
    o
    • 4
    • 8
  • l

    Luc Girardin

    01/18/2021, 10:11 PM
    Any chance of getting a version of Jetpack Compose compatible with the latest Kotlin compiler (1.4.30-RC)?!?
    j
    • 2
    • 2
  • c

    Colton Idle

    01/18/2021, 10:34 PM
    I have a List of Movies (list of movies could be in the 10000s) and each movie has a reviews. There can be hundreds of reviews left on a movie. I know its bad UX/design, but I want to show a list of Movies with ALL of the reviews listed in the same movie card. I'm not sure how to build this, because in the "android" world I would make the Movie List a RecyclerView, and each review section in the MovieCard would be a recyclerView too. But compose doesn't let you do that.
    LazyColumn{
        items(movies){
            MovieCard(it)
        }
    }
    
    MovieCard(movie: Movie){
        Text(movie.name)
        LazyColumn{
            items(movie.reviews){
                ReviewItem(it)
            }
        }
    }
    You get an error like this
    java.lang.IllegalStateException: Nesting scrollable in the same direction layouts like ScrollableContainer and LazyColumn is not allowed. If you want to add a header before the list of items please take a look on LazyColumn component which has a DSL api which allows to first add a header via item() function and then the list of items via items().
    Problem is solved if the LazyColumn in MovieCard just become a Column and I iterate with a for loop. BUT I want that inner loop to be performant and handle being super long. So I don't want a "dumb" Column. I need something that will recycle those ReviewItems.
    j
    k
    +2
    • 5
    • 19
  • s

    Suser

    01/19/2021, 8:00 AM
    Have there been any changes or considerations when adding a dependency to a compose-desktop app? i'm trying to add the dependency
    implementation("dev.chrisbanes.accompanist:accompanist-coil:0.4.2")
    from the mavenCentral() repository. I can see that this file is there on maven central but i get:
    CCould not resolve dev.chrisbanes.accompanist:accompanist-coil:0.4.2.
    Required by:
        project :
    
    Possible solution:
     - Declare repository providing the artifact
    s
    • 2
    • 5
  • l

    Luc Girardin

    01/19/2021, 2:19 PM
    I am trying to create a multiplatform library with both JVM (Compose) and JS target. To do so, I configure it using I am trying to create a multiplatform library with both JVM (Compose) and JS target. To do so, I configure it using
    compose.desktop {
        application {
            disableDefaultConfiguration()
            from(kotlin.targets["compose"])
        }
    }
    With the JS target in legacy mode, everything compile and run just fine. In IR mode I however get the following error:
    :compileKotlinJsIr FAILED
    e:androidx.compose.compiler.plugins.kotlin.IncompatibleComposeRuntimeVersionException: You are using an outdated version of Compose Runtime that is not compatible with the version of the Compose Compiler plugin you have installed. The compose compiler plugin you are using (version 1.0.0-alpha11) expects a minimum runtime version of 1.0.0-alpha11.
    Is there maybe a workaround or is there another option to limit the scope of the Compose plugin?
    b
    o
    • 3
    • 5
  • s

    suresh

    01/19/2021, 8:11 PM
    https://medium.com/graalvm/graalvm-21-0-introducing-a-new-way-to-run-java-df894256de28#ddc7:~:text=build%20native%20[…]g%20applications%20on%20Linux - New graalvm release added native image support for AWT and Swing applications on Linux. Hopefully this will allow us to create native image of compose applications 🙂
    🎉 10
    s
    g
    m
    • 4
    • 14
  • r

    Rajashekar

    01/20/2021, 12:45 PM
    Hi Everyone! I was curious about compose for desktop. So I wanted to try it for the first time. Right now I'm using IDEA Ultimate Edition, I have chosen Template - Compose Desktop Application and Run the main function which shows "Hello World ". Now the JetpackDesktopWindow shows nothing but a blank screen which struggles to render following these logs below which I understood there is a missing file. Does anyone know what exactly this means?
    SkIcuLoader: datafile missing: C:\Users\rajas\.jdks\openjdk-15.0.2\bin\icudtl.dat.
    Exception in thread "AWT-EventQueue-0 @coroutine#2" java.lang.RuntimeException: Can't wrap nullptr
    	at org.jetbrains.skija.impl.Native.<init>(Native.java:12)
    	at org.jetbrains.skija.impl.Managed.<init>(Managed.java:15)
    	at org.jetbrains.skija.impl.Managed.<init>(Managed.java:11)
    	at org.jetbrains.skija.impl.RefCnt.<init>(RefCnt.java:7)
    	at org.jetbrains.skija.DirectContext.<init>(DirectContext.java:21)
    	at org.jetbrains.skiko.RenderTargetsKt.makeGLContext(RenderTargets.kt:6)
    	at org.jetbrains.skiko.SkiaLayer.draw(SkiaWindow.kt:55)
    	at org.jetbrains.skiko.HardwareLayer.redrawLayer(Native Method)
    	at androidx.compose.desktop.ComposeLayer.onFrame(ComposeLayer.kt:75)
    	at androidx.compose.desktop.ComposeLayer$onFrame$1.invokeSuspend(ComposeLayer.kt)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
    	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Can't wrap nullptr
    	at org.jetbrains.skija.impl.Native.<init>(Native.java:12)
    	at org.jetbrains.skija.impl.Managed.<init>(Managed.java:15)
    	at org.jetbrains.skija.impl.Managed.<init>(Managed.java:11)
    	at org.jetbrains.skija.impl.RefCnt.<init>(RefCnt.java:7)
    	at org.jetbrains.skija.DirectContext.<init>(DirectContext.java:21)
    	at org.jetbrains.skiko.RenderTargetsKt.makeGLContext(RenderTargets.kt:6)
    	at org.jetbrains.skiko.SkiaLayer.draw(SkiaWindow.kt:55)
    	at org.jetbrains.skiko.HardwareLayer.redrawLayer(Native Method)
    	at org.jetbrains.skiko.HardwareLayer.display(HardwareLayer.kt:20)
    	at org.jetbrains.skiko.HardwareLayer.paint(HardwareLayer.kt:16)
    	at java.desktop/sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
    	at java.desktop/sun.awt.RepaintArea.paint(RepaintArea.java:240)
    	at java.desktop/sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:371)
    i
    • 2
    • 6
  • x

    xetra11

    01/20/2021, 2:52 PM
    How do you guys stay informed for new released versions? since the github repo has no releases to watch I find it hard to follow
    i
    • 2
    • 3
  • d

    Dirk Hoffmann

    01/20/2021, 3:50 PM
    I try to get a layout of my app for the whole window like:
    Column {
        header() { }
        Row {
           leftBar() { }
           centerContent() { }
           rightBar() { }
        }
        footer() { }
    }
    where header, left/rightBar and footer "eat up" as much height as these components are (means whatever is in in them) and taking the center content "eat up the rest" of available window space. So that if I resize the window, header/footer height and left/rightBar width stay fixed (size depends only on their contents) but centerContent() stretches/expands to get all the new available space on resizing. Whenever I give the centerContent
    fillxxxSize()
    it also eats up the space of the components below/toTheRight, which then are no more visible. What's the way to have a component eat up all the space there is for it, but no more concerning components below beside it ???
    a
    • 2
    • 13
  • s

    SrSouza

    01/20/2021, 4:46 PM
    Hey folks, first, the Jetbrains Compose latest builds is sharing the latest Jetpack Compose Alpha artifacts? Second, I'm writing a library for Compose and I want to support Jetbrains Compose and Jetpack Compose with the same artifact, this is currently possible? If not, what is a recommendation to me build a artifact that will support both?
    j
    • 2
    • 1
  • k

    Kirill Grouchnikov

    01/20/2021, 6:52 PM
    Heads up, something is broken with
    Interaction.Pressed in interactionState
    +
    Modifier.toggleable
    in build 141. Getting the smallest repro now and filing a bug.
    • 1
    • 2
  • n

    nrobi

    01/21/2021, 6:12 AM
    I’m wondering what is the purpose of
    withJava()
    and if it’s really needed by compose? • If I use it, then my dependencies are not resolved (their
    jvm()
    configuration doesn’t contain
    withJava()
    ) • Otherwise I’m getting
    Could not find or load main class
    (not 100% sure if it’s related, but the package name looks okay, so I’m guessing
    withJava
    has something to do with sourceSet configuration 🤔)
    a
    i
    • 3
    • 3
  • v

    ventura

    01/21/2021, 11:21 AM
    How could I implement my own
    *.compose
    library calling native components in C/C++?
    o
    j
    k
    • 4
    • 15
  • r

    ragunathjawahar

    01/21/2021, 11:32 AM
    Curious, how would automatic updates on a CFD app look like? Any plans to make this available out-of-the-box like Electron? In case, if I were to implement it now, how would it look like. Looking for pointers. Many thanks in advance.
    s
    • 2
    • 2
  • k

    K J

    01/21/2021, 11:12 PM
    I seem to be getting a
    NoSuchMethodError
    when trying to add Compose Desktop to my current project. I'm using Kotlin 1.4.30-RC (though this happens with 1.4.20 as well) and Compose Alpha
    0.3.0-build141.
    j
    o
    • 3
    • 7
  • d

    Dirk Hoffmann

    01/22/2021, 3:18 PM
    what's the supposed way to log something in compose-desktop?
    i
    • 2
    • 1
  • o

    olonho

    01/22/2021, 3:59 PM
    We just implemented support for using Compose for Desktop in IntelliJ IDEA plugins. Take a look at https://github.com/JetBrains/compose-jb/tree/master/examples/intelliJPlugin.
    🎉 25
    😮 3
    👏 30
    a
    p
    • 3
    • 5
  • a

    alorma

    01/22/2021, 9:32 PM
    YAY! ComposeDebugDrawer is ready for Compose-Desktop! Thanks @Javier for his work on converting it to multiplatform!
    🙂 3
    🎉 9
    c
    • 2
    • 3
  • c

    Carson Holzheimer

    01/23/2021, 5:48 AM
    https://github.com/Chozzle/compose-macos-theme Just made this. Useful? I'm imagining doing the same for windows, then desktop UIs could share a lot of code.
    👍 15
    j
    a
    k
    • 4
    • 25
  • a

    arekolek

    01/23/2021, 11:54 AM
    How do you run your apps when developing? From command line or Gradle tool window in IDE? I’m having an issue with the latter that it uses a wrong JDK to run it, ending up in error:
    MainKt has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    ./gradlew run
    from command line works fine Where do I configure JDK for the IDE? (IntelliJ IDEA CE 2020.3.1)
    c
    d
    • 3
    • 8
  • d

    Dirk Hoffmann

    01/23/2021, 4:54 PM
    what's some easy lib/classes/onBoard support for I18n, any recommendations?
    s
    • 2
    • 3
  • q

    Qinghua

    01/24/2021, 6:02 AM
    If I use compose-desktop in macOS platform, how can I access macOS framework like PhotosKit to retrieve medias in current device?
    r
    j
    • 3
    • 3
  • r

    rsktash

    01/24/2021, 11:20 AM
    Hi @Arkadii Ivanov. I’ve asked many many many questions regarding implementation of decompose library. I’m using jetbrains compose, decompose, mvikotlin, ktor, Now I’m trying to navigate to first screen when api throws authentication error. How can I pass router to api service?
    a
    • 2
    • 50
  • j

    Jakob K

    01/24/2021, 1:55 PM
    Hey, is it possible to configure a
    WindowDraggableArea
    in a way that it does not override any possible interaction in its area? For example, if I define a
    WindowDraggableArea
    and put a
    Button
    inside of it, it is impossible to interact with the button (the draggable area seems to always be "on top").
    j
    • 2
    • 2
  • f

    Filip Wiesner

    01/24/2021, 4:38 PM
    Hello, is there a way to have scrollable content that is not clipped to the bounds of scrollable area?
    j
    m
    • 3
    • 4
  • y

    Yan Pujante

    01/24/2021, 6:57 PM
    I am on macOS and I am trying to build the windows version. Using
    ./gradlew packageMsi
    builds "successfully" but doesn't do anything. It seems that you need to be using a Windows machine to build a .msi package. Or not? That being said, can I build something on macOS that is runnable on Windows without building a .msi package?
    ➕ 2
    b
    a
    • 3
    • 6
Powered by Linen
Title
y

Yan Pujante

01/24/2021, 6:57 PM
I am on macOS and I am trying to build the windows version. Using
./gradlew packageMsi
builds "successfully" but doesn't do anything. It seems that you need to be using a Windows machine to build a .msi package. Or not? That being said, can I build something on macOS that is runnable on Windows without building a .msi package?
➕ 2
b

Big Chungus

01/24/2021, 7:14 PM
Native binaries usually require native hosts to build on. Same applies for compose desktop.
y

Yan Pujante

01/24/2021, 7:15 PM
Ok thanks
a

altavir

01/24/2021, 7:15 PM
Even on Windows, you need wix binaries for that.
b

Big Chungus

01/24/2021, 7:15 PM
You can build your msi in the github actions ;)
y

Yan Pujante

01/24/2021, 7:18 PM
oh really? that is so cool :)
b

Big Chungus

01/24/2021, 7:20 PM
Or just spin up a windows VM. Lots of options these days
View count: 4