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

    Javier

    10/05/2021, 3:34 PM
    is it mandatory to publish a kmp library using
    jvm("desktop")
    to get it working? I am getting issues where I can reference the functions from this lib in consumers. I have same publish logic than others kmp libraries, only difference is it has compose plugin and libs
    a
    • 2
    • 5
  • s

    SrSouza

    10/06/2021, 3:50 PM
    Does compose desktop already support transparent + blur app backgrounds?
    👀 3
    p
    • 2
    • 2
  • a

    Anatame

    10/06/2021, 6:44 PM
    Hey guys, I was planning to work a project with desktop compose. But unfortunately, when I tried the default Intellij template for desktop compose, I faced some serious memory issues. It had only one default button, nothing else. But every click on the button increases the memory usage in the task manager. Every click shoots up the memory usage. And it stays up. A simple hello button app was taking down 250MB memory after few clicks. It started with around 140MB.
    j
    o
    +2
    • 5
    • 20
  • k

    Kirill Grouchnikov

    10/07/2021, 7:16 PM
    @Igor Demin - I just upgraded to build 396, and looks like the version of
    ComposeWindow
    that gets parent composition is gone. But it's still there in https://github.com/androidx/androidx/blob/androidx-main/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt#L85. Is there a different branch that 396 is cut from, and if so, what is the new way to propagate all composition locals from the parent window to the new window?
    i
    • 2
    • 9
  • s

    Sean Proctor

    10/10/2021, 1:04 PM
    Is there a collection of desktop widget for compose? I'm looking for split pane with a drag handle.
    o
    • 2
    • 2
  • j

    Jakob

    10/11/2021, 12:12 AM
    Hello, I was trying to use compose for desktop to turn the code viewer example into a code editor. Instead of many lines I used a multiline
    BasicTextField
    . However I ran into some serious performance issues. Is there a better way to write a basic code editor in compose?
    k
    z
    • 3
    • 3
  • j

    Jakob

    10/11/2021, 12:13 AM
    For now I just use an embedded JComponent
    o
    • 2
    • 1
  • a

    Akram Bensalem

    10/11/2021, 10:48 AM
    How to import swing librey into Compose desktop ? I want to import
    LGoodDatePicker
    but I didn't know how to import it! https://github.com/LGoodDatePicker/LGoodDatePicker
    z
    • 2
    • 1
  • b

    bartosz.malkowski

    10/11/2021, 3:33 PM
    Hi! Im trying to manage Notifications. I have component class with
    PublishSubject
    . I also have
    @Composable
    function where I want to show notification based on data received from subject. How to do that?
    @Composable
    fun test(component: MainComponent){
    	val subject: Observable<NotificationData> = component.notification
    	
    	val trayState = rememberTrayState()
    	Tray(state = trayState,
    		 icon = TODO())
    	
    	val n = rememberNotification("Title From NotificationData", "Message from NotificationData")
    	trayState.sendNotification(n)
    }
    a
    • 2
    • 1
  • s

    spierce7

    10/11/2021, 8:20 PM
    Hey - Why can’t I access
    ImageBitmap
    pixels directly? If I wanted to create a filter for
    ImageBitmap
    it doesn’t seem very intuitive. Is ImageBitmap even the best abstraction for me to create a filtering system on?
    k
    • 2
    • 12
  • a

    Akram Bensalem

    10/12/2021, 10:30 AM
    Why LazyList stop dragging when cursor is hover a textField (the textfield is not Foucasable) ? Is there a way to fix this behaviour ?
    i
    • 2
    • 2
  • b

    bartosz.malkowski

    10/12/2021, 12:06 PM
    Hi! I found weird think. I've run TodoApp on my Mac and I saw that application takes 100% of CPU. But only if input field has focus (means: when cursor in field is blinking). I don't think it is normal. Is there something I can do with it or I have to wait to fix in Compose?
    i
    • 2
    • 2
  • c

    Colton Idle

    10/12/2021, 1:30 PM
    After adding a common module (followed the multiplatform compose-jb template) I get this popup, but the full message says this:
    Compilation is not supported for following modules: rollertoaster.desktop.commonMain, rollertoaster.commoncomposables.androidAndroidTestRelease, rollertoaster.commoncomposables.androidTestFixtures, rollertoaster.commoncomposables.androidTestFixturesDebug, rollertoaster.commoncomposables.androidTestFixturesRelease, rollertoaster.commoncomposables.commonMain, rollertoaster.commoncomposables.commonTest, rollertoaster.commoncomposables.desktopMain, rollertoaster.commoncomposables.desktopTest. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
    Did I setup something incorrectly? Maybe that's the reason why I'm seeing this error? https://github.com/JetBrains/compose-jb/issues/1132
    j
    u
    i
    • 4
    • 16
  • s

    Stefan Oltmann

    10/13/2021, 11:53 AM
    How do I find out the current directory of my EXE on Windows?
    File(".").absolutePath
    returns the working directory which I could change in a symlink.
    Server.class.getProtectionDomain().getCodeSource().getLocation().getPath()
    results in NullPointer if started from the EXE. Is there something compose specific to find that out?
    ✅ 1
    t
    e
    • 3
    • 16
  • c

    Cody Mikol

    10/13/2021, 1:23 PM
    Hey all, what is the best resource for learning how to use compose-desktop ? Right now I’m just trying things blindly.
    c
    m
    • 3
    • 3
  • w

    Waqas Tahir

    10/13/2021, 3:23 PM
    found : moko-resources ,
    🧵 1
    a
    • 2
    • 2
  • j

    Jakob

    10/13/2021, 7:32 PM
    Hello, I have a nested
    JComponent
    inside a compose component that gets scaled. The jetpack components scale but the
    JComponent
    doesn't. How would I go about getting the
    JComponent
    to scale also? If I can get the local scale factor and a callback for when it changes then I can scale the
    JComponent
    manually. But
    LocalDensity
    doesn't have this and I'm not sure where else to find it.
    • 1
    • 1
  • a

    andylamax

    10/14/2021, 3:12 AM
    Hypothetical question. How complicated would it be to add compose to the codenameone https://github.com/codenameone/CodenameOne project? I wanted to create an issue there on weather they can switch to declarative UI (suggesting compose 4 desktop as a go to solution), but had to ask how feasible it is. Thoughts??
    r
    x
    s
    • 4
    • 4
  • b

    bartosz.malkowski

    10/14/2021, 11:26 AM
    What may cause this exception?
    Exception in thread "AWT-EventQueue-0" kotlin.UninitializedPropertyAccessException: lateinit property relocationRequesterNode has not been initialized
    	at androidx.compose.ui.layout.RelocationRequesterModifier.getRelocationRequesterNode(RelocationRequesterModifier.kt:32)
    	at androidx.compose.ui.layout.RelocationRequester.bringIntoView(RelocationRequester.kt:61)
    	at androidx.compose.ui.layout.RelocationRequester.bringIntoView$default(RelocationRequester.kt:59)
    	at androidx.compose.foundation.FocusableKt$focusable$2$4$1.invokeSuspend(Focusable.kt:108)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    	at androidx.compose.ui.platform.FlushCoroutineDispatcher$dispatch$2.invokeSuspend(CoroutineDispatchers.desktop.kt:55)
    	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:313)
    	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(Native Method)
    	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)
    :thread-please: 3
    ➕ 1
    a
    a
    • 3
    • 5
  • w

    wilddev

    10/14/2021, 6:35 PM
    Hi, is it possible in "compose" or "compose-desktop" to handle something like onMouseDown? Tried Modifier.pointerInput/detectTapGestures, but that is called only like onMouseUp
    c
    z
    • 3
    • 2
  • s

    Stefan Oltmann

    10/15/2021, 12:10 PM
    How can I pass command line arguments to my EXE von Windows?
    MyApp.exe hello
    results in
    Failed to launch JVM
    Background: My use case is that I registered a custom URI scheme "myapp://" on Windows and I want to pass all that into my EXE to get back the OAuth response. Is it really possible that the EXE produced by jpackage is not capable of passing cmd line arguments? 🤔
    m
    • 2
    • 6
  • s

    Slackbot

    10/15/2021, 10:46 PM
    This message was deleted.
    k
    r
    • 3
    • 2
  • w

    Waqas Tahir

    10/16/2021, 7:58 AM
    Using compose in a multiplatform project , getting the error : e: This version (1.1.0-alpha01) of the Compose Compiler requires Kotlin version 1.5.21 but you appear to be using Kotlin version 1.5.31 which is not known to be compatible. Please fix your configuration (or
    suppressKotlinVersionCompatibilityCheck
    but don't say I didn't warn you!). FAILURE: Build failed with an exception. with this build.gradle file
    plugins {
        kotlin("multiplatform")
        id("org.jetbrains.compose") version "1.0.0-alpha3"
        id("com.android.library")
        id("kotlin-android-extensions")
    //    id("com.vanniktech.maven.publish")
        id("maven-publish")
    }
    
    group = BuildConfig.Info.group
    version = BuildConfig.Info.version
    
    android {
        compileSdkVersion(BuildConfig.Android.compileSdkVersion)
        sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
        defaultConfig {
            minSdkVersion(BuildConfig.Android.minSdkVersion)
            targetSdkVersion(BuildConfig.Android.targetSdkVersion)
        }
        compileOptions {
            sourceCompatibility = JavaVersion.VERSION_1_8
            targetCompatibility = JavaVersion.VERSION_1_8
        }
    }
    
    kotlin {
        android {
            publishLibraryVariants("release", "debug")
        }
        jvm("desktop") {
            compilations.all {
                kotlinOptions.jvmTarget = "11"
            }
        }
        sourceSets {
            val commonMain by getting {
                dependencies {
                    api(compose.runtime)
                    api(compose.foundation)
                    api(compose.material)
                    implementation(project(":core"))
                }
            }
            val commonTest by getting {
                dependencies {
                    implementation(kotlin("test"))
                }
            }
            val androidMain by getting
            val androidTest by getting {
                dependencies {
                    implementation("junit:junit:4.13.2")
                }
            }
            val desktopMain by getting {
                dependencies {
                    api(compose.preview)
                }
            }
            val desktopTest by getting
        }
    }
    :thread-please: 1
    j
    s
    a
    • 4
    • 12
  • m

    mcpiroman

    10/16/2021, 7:51 PM
    I'd like to implement a graph view, similar to the one found in disassemblers (

    example from cutter▾

    ). It should support dragging and (limited) zooming. There are many nodes, most of them won't fit onto screen. Does someone have any recommendations on how to achieve that? Should I just use one mega
    Box
    or `Layout`and
    Modifier.offset
    elements? Or maybe a skika canvas? Would that support efficiently offscreen content? Or maybe I should ask in #compose?
    w
    o
    j
    • 4
    • 16
  • d

    darkmoon_uk

    10/16/2021, 11:06 PM
    Any experiences here of integrating a Map component with Desktop Compose?
    j
    • 2
    • 6
  • c

    Catry

    10/17/2021, 1:14 PM
    how to make a sidebar?
    k
    w
    • 3
    • 3
  • c

    Catry

    10/18/2021, 7:16 AM
    y
    • 2
    • 1
  • a

    Ayfri

    10/18/2021, 4:19 PM
    Hi, how can I force the color of the text in a
    @Composable
    function (with a
    content: @Composable () -> Unit
    argument) like in the
    Button
    Composable ?
    b
    c
    c
    • 4
    • 4
  • d

    darkmoon_uk

    10/19/2021, 2:15 AM
    Just leaving this here for my fellow Compose/MP explorers, to maybe save you the three hours... 😭
    🙌 2
    x
    • 2
    • 1
  • e

    eygraber

    10/19/2021, 4:09 AM
    If I get an IR error while building a desktop app (
    java.lang.IllegalArgumentException: Failed requirement.
    ) should I file that in issuetracker or https://github.com/JetBrains/compose-jb? Full stack trace and repo in 🧵
    • 1
    • 2
Powered by Linen
Title
e

eygraber

10/19/2021, 4:09 AM
If I get an IR error while building a desktop app (
java.lang.IllegalArgumentException: Failed requirement.
) should I file that in issuetracker or https://github.com/JetBrains/compose-jb? Full stack trace and repo in 🧵
Repro at https://github.com/eygraber/portal/pull/1
Untitled.txt
https://issuetracker.google.com/issues/203557328
View count: 3