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

    gpaligot

    10/19/2021, 7:34 PM
    Hi, I would like to know: If I have a KMP project (for now, only Android and Desktop targets) and with shared compose components, there is any way to write composable tests in the common source set or I need to choose between Android and Desktop?
    d
    u
    • 3
    • 12
  • c

    Colton Idle

    10/20/2021, 3:14 PM
    Holy crap. I think CfD finally works correctly for me in Android Studio. All of my red lines seem to be gone. The trick (seemingly) was to delete the .idea/modules.xml file and then clean > rebuild. 😛arty-parrot:
    🎉 12
    • 1
    • 1
  • p

    ppvi

    10/21/2021, 11:32 AM
    There are a couple of threads about it but no clear answer: does
    rememberSaveable
    do anything on desktop currently?
    i
    • 2
    • 3
  • c

    Catry

    10/21/2021, 12:08 PM
    https://github.com/JetBrains/compose-jb/issues/1174 🤔
    • 1
    • 2
  • p

    Pavle Joksovic

    10/21/2021, 1:13 PM
    Hi, I'm trying to find a way to bundle assets (aapt, adb, android.jar, etc.) with the dmg and exe files, is there an easy way to do this?
    👀 2
    c
    b
    • 3
    • 8
  • c

    Colton Idle

    10/22/2021, 7:09 AM
    Can I share this code between Android + Desktop somehow?
    private val Rubik =
        FontFamily(
            Font(R.font.rubik_regular, FontWeight.Normal),
            Font(R.font.rubik_bold, FontWeight.Bold),
            Font(R.font.rubik_medium, FontWeight.Medium))
    or do I have to do some sort of expect/actual thing here?
    i
    m
    • 3
    • 6
  • p

    Philip Dukhov

    10/22/2021, 9:00 AM
    How to add opt-in annotation to
    build.gradle.kts
    ? In Android I can use
    android.kotlinOptions.freeCompilerArgs += "..."
    , in KMM -
    kotlin.sourceSets.all.languageSettings.optIn("...")
    , but how to do it in compose-desktop?
    a
    • 2
    • 1
  • k

    Kirill Grouchnikov

    10/22/2021, 2:29 PM
    :thank-you: 4
    :compose-desktop: 7
    :mandalorian: 1
    👏 8
    🖥️ 7
    🚀 20
    :jetpack-compose: 18
    ❤️ 8
    🔥 17
    :kotlin-intensifies: 47
    💪 8
    😲 6
    s
    j
    +4
    • 7
    • 7
  • k

    Kebbin

    10/23/2021, 7:45 AM
    Looks like a good time to turn up here! 😄
    💯 2
    d
    c
    • 3
    • 29
  • f

    František Jeřábek

    10/23/2021, 9:29 AM
    Hi i am trying to run compose app on raspberry pi 3. I have simple app with button and counter and it is for some reason laggy (The button ripples). Is compose really that performance heavy that raspberry pi 3 could not handle it ? If i create similar UI in javaFX it runs smooth. Does anyone know if there is something that I could be doing wrong or compose is just not suitable for raspberry pi 3 ?
    o
    • 2
    • 3
  • s

    smallshen

    10/24/2021, 12:13 AM
    doesn anyone know why the ripple is not gray?
    ➕ 1
    a
    • 2
    • 1
  • c

    Colton Idle

    10/24/2021, 4:04 PM
    anyway to have this on the docs say beta1 as latest?
    h
    o
    i
    • 4
    • 4
  • t

    theapache64

    10/24/2021, 6:55 PM
    🤔 What’s actually happening inside
    ::exitApplication
    ?
    System.exit(0)
    or something special? Just curious 😬
    ➕ 2
    c
    k
    i
    • 4
    • 8
  • p

    Pavle Joksovic

    10/25/2021, 10:16 AM
    Following the guide here
    System.getProperty("compose.application.resources.dir")
    returns
    .../app/build/compose/tmp/main/resources
    which doesn't exist. What am I doing wrong?
    o
    a
    • 3
    • 3
  • j

    Jakob K

    10/25/2021, 1:19 PM
    How can I execute a left mouse click on a
    ComposeScene
    ? I already tried
    scene.sendPointerEvent(PointerEventType.Press, offset)
    but either I am doing something wrong (maybe with the
    Offset
    ?) or more is required to achieve this. (Regarding the offset, I already tried pixel coordinates and a scale from
    0f
    to
    1f
    .)
    ✅ 1
    i
    • 2
    • 2
  • j

    Jakob K

    10/25/2021, 2:40 PM
    ComposeScene
    has the
    hasInvalidations
    function, which I currently check periodically. Is there a way to setup a callback which will be executed if this value changes to true?
    i
    • 2
    • 5
  • k

    Karlo Lozovina

    10/26/2021, 9:16 PM
    I'm trying to implement editable Text myself, and I'm stuck right at the beginning - how to show the cursor when the user clicks somewhere in the text? ClickableText gives me the index of the clicked character, but that's not enough to show the cursor - I need the pixel position and the height of the cursor to display. Any pointers appreciated...
    s
    • 2
    • 4
  • s

    SrSouza

    10/27/2021, 4:34 PM
    👀 :kotlin-intensifies:
    :kotlin-intensifies: 10
    👀 15
    😲 13
    a
    b
    +2
    • 5
    • 5
  • k

    Karlo Lozovina

    10/27/2021, 9:38 PM
    How can I capture key events happening on a
    ClickableText
    ? I've tried with
    Modifier.onPreviewKeyEvent
    but nothing seems to be happening...
    s
    • 2
    • 5
  • x

    xxfast

    10/28/2021, 12:29 AM
    so em.. this question might be too early, but is it safe to assume that material3.compose apis won’t make it’s way to compose multiplatform soon?
    ➕ 1
    s
    k
    +2
    • 5
    • 6
  • m

    mikehearn

    10/28/2021, 3:59 PM
    Hi. Is there a way to make the Gradle plugin produce just a set of JARs - not an uber jar or a jlinked package, but what you'd get in the lib directory if using
    installDist
    on a normal Gradle application module.
    d
    • 2
    • 1
  • k

    Kirill Grouchnikov

    10/28/2021, 7:24 PM
    @Igor Demin - I think the code in https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]kotlin/androidx/compose/foundation/Scrollbar.desktop.kt;l=222 (desktop scrollbar) needs something along these lines to support RTL mode (see code in thread)
    i
    • 2
    • 7
  • k

    Kirill Grouchnikov

    10/28/2021, 7:41 PM
    https://github.com/JetBrains/compose-jb/tree/master/tutorials/Mouse_Events#mouse-rightmiddle-clicks-and-keyboard-modifiers has been reworked recently from
    Modifier.pointerInput
    to
    Modifier.mouseClickable
    . At the very end it says
    If you need more information about events there is an available raw AWT mouse event object in mouseEvent property of PointerEvent
    but it's not clear where is that
    PointerEvent
    . More specifically, what is the equivalent of
    MouseEvent.isPopupTrigger
    - which is pressed on mac, but released on windows?
    i
    • 2
    • 15
  • c

    Colton Idle

    10/29/2021, 4:39 AM
    I'm going back into my old projects and trying to add @Preview since I was able to get it to work now in plain old Android Compose projects. But now I have a jetbrains compose project, and I have an
    androidMain
    folder that I'd like to be able to use @Preview. Then in my commoncomposables module build.gradle.kts I have
    named("androidMain") {
      dependencies {
        implementation("androidx.compose.ui:ui-tooling-preview:1.1.0-beta01")
        implementation("androidx.compose.ui:ui-tooling:1.1.0-beta01")
    But as you can see, the IDE doesn't give me the code/design/split pane. Does anyone know if I should be able to see that pane so I can have previews without deploying to device? Note: I don't care about previewing my desktop composables or anything, I just want my androidMain folder to be able to preview as you would in a normal android compose app.
    j
    c
    • 3
    • 10
  • o

    olonho

    10/29/2021, 11:06 AM
    https://blog.jetbrains.com/kotlin/2021/10/compose-multiplatform-goes-beta/
    ❤️ 9
    🎉 26
    👀 4
    🤠 3
    c
    h
    a
    • 4
    • 4
  • m

    mikehearn

    10/29/2021, 6:06 PM
    The obvious hack would be to just +x it from inside your app code
    s
    • 2
    • 1
  • d

    dimsuz

    10/30/2021, 2:43 PM
    Congrats with beta release! I'm curious: the blog post said,that compose-desktop now uses google artifacts directly, but I've updated my playground-project to
    1.0.0-beta05
    and if I go to e.g.
    MaterialTheme.kt
    I can still see that IDE locates it in
    material-desktop.jar
    . I did resync and clean build project, this is still a thing. Is this supposed to be so?
    j
    • 2
    • 3
  • d

    Deklan Webster

    10/30/2021, 9:29 PM
    are there any open source Compose Desktop apps in the wild right now? Preferably not demos, but apps intended to be used
    m
    • 2
    • 1
  • a

    automike

    10/31/2021, 12:49 AM
    Besides the jetpack for android tutorials, can anyone recommend any good tutorial for compose desktop?
    m
    p
    • 3
    • 4
  • s

    SrSouza

    10/31/2021, 7:49 PM
    I'm having couple issues with transparency support on Linux, • At my second monitor (4k one) it fails to setup SkiaLayer with a exception (in thread). • When It get open at my primary monitor (2k) it have a poor performance, when I switch my second monitor to 2k the peformance get alot better. (the application is still being displayed at the first monitor) • When I try to move the window to the second monitor (SUPER + SHIFT + LEFT) it gives my the exception in the first case and stop working.
    o
    • 2
    • 4
Powered by Linen
Title
s

SrSouza

10/31/2021, 7:49 PM
I'm having couple issues with transparency support on Linux, • At my second monitor (4k one) it fails to setup SkiaLayer with a exception (in thread). • When It get open at my primary monitor (2k) it have a poor performance, when I switch my second monitor to 2k the peformance get alot better. (the application is still being displayed at the first monitor) • When I try to move the window to the second monitor (SUPER + SHIFT + LEFT) it gives my the exception in the first case and stop working.
Cannot create Linux GL context
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: SkiaLayer is disposed
	at org.jetbrains.skiko.SkiaLayer.update$skiko(SkiaLayer.jvm.kt:408)
	at org.jetbrains.skiko.redrawer.AbstractDirectSoftwareRedrawer.redrawImmediately(AbstractDirectSoftwareRedrawer.kt:36)
	at org.jetbrains.skiko.redrawer.LinuxSoftwareRedrawer.redrawImmediately(LinuxSoftwareRedrawer.kt:24)
	at org.jetbrains.skiko.SkiaLayer.paint(SkiaLayer.jvm.kt:317)
	at androidx.compose.ui.awt.ComposeLayer$ComponentImpl.paint(ComposeLayer.desktop.kt:100)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5271)
	at java.desktop/javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:246)
	at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1060)
	at java.desktop/java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
	at java.desktop/sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:75)
	at java.desktop/sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:112)
	at java.desktop/java.awt.Container.paint(Container.java:2003)
	at java.desktop/java.awt.Window.paint(Window.java:3949)
	at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:876)
	at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823)
	at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772)
	at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1884)
	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)
fun main() = application {
    Window(
        onCloseRequest = ::exitApplication,
        undecorated = true,
        transparent = true,
    ) {
        Surface(
            modifier = Modifier.fillMaxSize().shadow(3.dp, RoundedCornerShape(20.dp)),
            color = Color(55, 55, 55),
            shape = RoundedCornerShape(20.dp) //window has round corners now
        ) {
            Text("anything")
        }
    }
}
o

olonho

10/31/2021, 9:31 PM
Better report an issue
🆗 1
s

SrSouza

10/31/2021, 10:18 PM
https://github.com/JetBrains/compose-jb/issues/1339
View count: 5