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
  • l

    Luis Alonso Ato Neyra

    11/27/2022, 12:10 AM
    hi there! I’m wondering how to manage state in compose desktop. Are you using viewmodels? We use viewmodel in android because of it’s lifecyclle aware but here there is no change orientation and that stuff. Do you create your own viewmodel? Or are you using MVI, MVP?
    t
    m
    • 3
    • 3
  • m

    Michael Paus

    11/28/2022, 11:10 AM
    Can anybody explain me the relationship between 1.3.0-alpha01-dev862 and 1.3.0-beta03. The alpha is more recent than the beta. What’s the logic behind that?
    i
    • 2
    • 1
  • r

    Ryan Smith

    11/28/2022, 11:33 PM
    What is the recommended way of managing coroutines in a Compose Desktop app? At the moment I'm trying the following: • Get an application-level scope using
    MainScope()
    from my
    application
    block and pass it around • My ViewModel instances receive the application
    CoroutineScope
    as a constructor parameter and setup a view model scope from that using
    CoroutineScope(coroutineScope.coroutineContext + SupervisorJob())
    • My ViewModel instances launch coroutines to the data layer using
    scope.launch
    or
    scope.async
    builders. • At application shutdown, the application coroutine scope has it's
    cancel
    method called like
    appCoroutineScope.cancel("Application Shutdown")
    I originally thought this was sufficient to make sure all jobs were correctly cancelled on shutdown, but I haven't been able to convince myself things are actually shutting down properly.
    a
    c
    +2
    • 5
    • 21
  • f

    frank

    11/29/2022, 11:33 AM
    I don't know how to consume
    Flow
    properly in Compose Desktop, I have searched but only find examples for Android. I get the data from Kmongo:
    class TagDAO {
        companion object {
            private val tagsDB by lazy { Connection().getCollection<Tag>("tags") }
            fun listTags(): Flow<Tag> {
                return tagsDB.find().toFlow()
            }
        }
    }
    
    @Composable
    fun form() {
      val tagsFlow = TagDAO.listTags() // Flow<Tag>
      val tagsState by tagsFlow.collectAsState(initial = Tag()) // Only return last value
    }
    h
    • 2
    • 2
  • s

    Sebastian Kürten

    11/29/2022, 5:19 PM
    Hey, I'm working on a Gradle plugin that allows packaging Compose applications cross-platform. It's called pinpit: https://github.com/mobanisto/pinpit-gradle-plugin
    b
    m
    d
    • 4
    • 12
  • k

    kevin.cianfarini

    11/29/2022, 9:36 PM
    Does this stacktrace ring a bell to any of the folks working on
    compose-jb
    ? I’m trying to expose a molecule flow to an iOS framework and I’m getting the following error.
    e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (36,9) in /Users/kevin/code/Flapjack/shared/src/iosMain/kotlin/energy/octopus/octopusenergy/viewmodel/iosBinding.kt
    for the following code
    abstract class MoleculeViewModel<UiAction : Any, ViewState : Any> {
    
        /**
         * Ingest a [Flow] of [UiAction], react to those actions, and produce a [ViewState].
         */
        @Composable internal abstract fun viewState(events: Flow<UiAction>): ViewState
    }
    
    fun MoleculeViewModel<...>.subscribe(...) {
        ...
        val flow = coroutineScope.launchMolecule(RecompositionClock.Immediate) {
            this.viewState(events.consumeAsFlow())
        }
        ...
    }
    The full stacktrace is in the thread. It’s looking like an upstream
    NullPointerException
    ?
    n
    • 2
    • 6
  • e

    eygraber

    11/30/2022, 5:42 AM
    I tried out CfD for js (experimental) and I'm getting a lot of
    Internal error in body lowering
    back end IR errors. Is the project in a state where bug reports would just be noise because it's still experimental, or would they be helpful. If the latter, what is the best place to report them (Kotlin youtrack or compose-jb issue tracker)?
    o
    • 2
    • 2
  • k

    Kirill Grouchnikov

    11/30/2022, 2:12 PM
    A screenshot of Jewel, a bridge from Swing’s Darcula look-and-feel used in IntelliJ into the desktop Compose world
    s
    s
    c
    • 4
    • 17
  • m

    mikehearn

    11/30/2022, 3:19 PM
    Maybe this is better for #compose but I'm curious - it seems like the way theming is handled in Compose (and obv. reactjfs as well) is that in effect, every theme is its own widget toolkit. This is very different to OOP toolkits, where a theme is a set of styles or objects that render the stock controls for you. It seems common that these 'themes' aren't documented at all, which seems problematic - if you want to port or switch from one theme to another, how do you know the one you want has all the features and APIs you need? Why does each 'theme' have to reinvent a button out of boxes and other low level primitives?
    k
    b
    • 3
    • 8
  • m

    mikehearn

    11/30/2022, 3:22 PM
    Most obviously, IntelliJ lets you change Swing themes. There seems no way to implement a similar feature for Compose (Desktop).
    k
    • 2
    • 5
  • c

    Colton Nohelty

    12/01/2022, 1:50 AM
    I probably missed this in an obvious location, but does anyone know where I can find the contribution guidelines for jb-compose?
    k
    n
    • 3
    • 4
  • e

    eygraber

    12/01/2022, 1:57 AM
    Just double checking, VERSIONING.md sounds like it's saying that we can use a version of Google's compose compiler through the
    kotlinCompilerPlugin
    property. Is that accurate? e.g. if I set that property to
    androidx.compose.compiler:compiler:1.4.0-alpha02
    would I be able to update Kotlin 1.7.21 in my jetbrains compose project?
    j
    a
    • 3
    • 23
  • c

    Colton Idle

    12/01/2022, 3:50 AM
    i haven't touched CfD in a while. Going back to it today. I'm following the wizard in the newest 2022.3 of intellij. What JDK should I be targetting?
    k
    i
    m
    • 4
    • 4
  • k

    Kirill Grouchnikov

    12/01/2022, 3:18 PM
    It’s time for a fresh new release of Aurora. New in release 1.3.0 (code-named December): • APIs to configure the window title pane, with option to extend application content into the integrated title pane • APIs to configure placement and alignment of popup content • New switch and tri-state checkbox components • New presentation options for rich tooltips and text fields • Added highlight painter to skins • Fixes for right-to-left support
    s
    • 2
    • 2
  • e

    eygraber

    12/02/2022, 12:01 AM
    Is there a known issue where
    verticalScroll
    doesn't work in js?
    o
    a
    • 3
    • 6
  • e

    eygraber

    12/02/2022, 4:09 AM
    I'm looking into an issue where
    PointerButton
    isn't mapped to the values that Compose expects it to be on Ubuntu with an MX Master 3 mouse. I'd greatly appreciate it if anyone could try this Modifier with other combinations of mice and OSes and report if they have similar or different results 🙏
    Modifier
        .onClick(matcher = PointerMatcher.mouse(PointerButton(0)), onClick = { println("Mouse Left") })
        .onClick(matcher = PointerMatcher.mouse(PointerButton(1)), onClick = { println("Mouse Right") })
        .onClick(matcher = PointerMatcher.mouse(PointerButton(2)), onClick = { println("Mouse Middle") })
        .onClick(matcher = PointerMatcher.mouse(PointerButton(3)), onClick = { println("Horizontal Scroll Right") })
        .onClick(matcher = PointerMatcher.mouse(PointerButton(4)), onClick = { println("Horizontal Scroll Left") })
        .onClick(matcher = PointerMatcher.mouse(PointerButton(5)), onClick = { println("Mouse Back") })
        .onClick(matcher = PointerMatcher.mouse(PointerButton(6)), onClick = { println("Mouse Front") })
        .onClick(matcher = PointerMatcher.mouse(PointerButton(7)), onClick = { println("Mouse Thumb") })
    o
    c
    • 3
    • 8
  • a

    Alexander Maryanovsky

    12/02/2022, 3:57 PM
    Bold text is measured taller than regular text on the desktop. On Android it’s the same. Is that a bug or expected behavior?
    s
    k
    +2
    • 5
    • 44
  • r

    Ryan Smith

    12/03/2022, 5:26 PM
    Is there built-in support for scroll bars on LazyColumn? I'm finding a lot of roll-your-own solutions on the internet so far, but it feels like something that would come baked in.
    • 1
    • 1
  • p

    Pablo

    12/04/2022, 10:55 PM
    Does exist a simple way to add scroll movement on a LazyColumn dragging the content with the mouse instead that being forzed to drag the scrollbar?
    a
    • 2
    • 3
  • m

    mikehearn

    12/05/2022, 11:26 AM
    📢 Conveyor 5 is now out and adds support for packaging apps that use URL handlers, along with a new "aggressive" online updates mode. Aggressive updates bring a useful feature of the web to desktop apps by doing a fast synchronous update check on every launch, then applying the update and continuing without any user intervention. You can use it to tightly synchronize a client with a server protocol, for example, or just to ensure users are always seeing the latest code. With Windows' built in delta updates it's fast too. Check out the tutorial to see how to package Compose Desktop apps.
  • p

    Pablo

    12/05/2022, 8:29 PM
    Which is the simplest and better way to display dialogs when a button is pressed? I only can find samples that sets true a "showDialog" variable that is checked in "visible" property of Dialog, being Dialog on the logic of the screen but simply not visible until that variable has changed. I really don't like this approach. I whould prefeer simply calling a Composable function called "DisplayDialog" in the onclick event of the button. That function has the logic for showing the dialog, but doing that results in an exception: "@Composable invocations can only happen from the context of a @Composable function"
    z
    a
    • 3
    • 2
  • a

    Alex Styl

    12/06/2022, 1:38 AM
    I am doing
    notarizeReleaseDmg
    on a github action. The gradle task always hangs in the
    createReleaseDmg
    part. I removed the signing block in the build.gradle.kts part and the build works without an issue. Not sure how to debug this. Locally I can create the dmg, sign and notarize it using the notarize dmg task without a problem I understand this is not entirely compose-desktop related but maybe others faced this issue before, and maybe you can give some ideas.
  • a

    Anmol Verma

    12/06/2022, 5:29 PM
    Hi folks! Any references for deep links and local platform notifications with tap to navigate with a notification identifier ?
    a
    m
    • 3
    • 18
  • c

    Casey Brooks

    12/06/2022, 7:49 PM
    Here’s a preview of using Ballast Navigation in a Desktop application, with forward/backward navigation buttons implemented with Ballast Undo.
    Screen Recording 2022-12-06 at 1.36.43 PM.mov
    • 1
    • 1
  • s

    Slackbot

    12/06/2022, 11:41 PM
    This message was deleted.
  • p

    Pablo

    12/07/2022, 5:03 PM
    Imagine a main App composable function, which has a file chooser for selecting a file and a call to another composable function called listFiles that prints the content of the selected file by te file chooser. If i select two different files, the listFiles function is called two times. But if I select two times the same file, the listFiles function source code is not being executed for the second file. Even if no condition is checked for calling the function. How is that possible? Does Compose execute some "hidden" logic before execute a composable function that checks if the function has been called previously with exactly the same parameters and if so it does not execute the code?
    k
    • 2
    • 28
  • a

    ayodele

    12/07/2022, 8:58 PM
    Has anyone noticed that
    PointerEventType.Move
    is always called even if the mouse is not moving?
    d
    k
    • 3
    • 5
  • e

    enighma

    12/07/2022, 11:07 PM
    Re: constraintlayout-compose Not sure if it's been asked but are there any plans add ConstraintLayout Compose to CD*?* or is it somehow coupled to Android?
  • g

    Guilherme Delgado

    12/07/2022, 11:16 PM
    I’m trying to send a broadcast command with
    ProcessBuilder
    . It “works”, but the output is different if I run the same command via terminal:
    ~ adb shell am broadcast -p com.sample -a sample.action -e "extra" "bla bla"
    produces (correctly):
    Broadcasting: Intent { act=sample.action flg=0x400000 pkg=com.sample (has extras) }
    Broadcast completed: result=0
    but the same command via
    ProcessBuilder
    produces:
    Broadcasting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x400000 pkg= -p }
    Broadcast completed: result=0
    any idea why? 🤔
    k
    j
    • 3
    • 4
  • e

    eygraber

    12/07/2022, 11:45 PM
    Where does the
    jsNativeMain
    source set come from in the Jetbrains compose repo?
Powered by Linen
Title
e

eygraber

12/07/2022, 11:45 PM
Where does the
jsNativeMain
source set come from in the Jetbrains compose repo?
View count: 4