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

    David Dupraz

    06/23/2021, 1:25 PM
    Hello, I have a problem in a card game project. I'm currently reworking some mechanisms to store the state in a normal class (without Composable methods) and make the GUI just watching this state. To synchronise both, I'm using some Composable callback. But for an unknown reason, the GUI does not recompose itself when state changes. It seems that notifications of the callbacks don't work, but I can't find why. Do you have an idea ? I put in a thread a link to a small reproducer and a video showing the issue.
    i
    m
    • 3
    • 6
  • c

    Christian Babsek

    06/23/2021, 2:50 PM
    Hello, is there a way to react on mouse scrolling events? (like scroll up, scroll down with the mouse wheel)? Thank you very much 🙂
    o
    • 2
    • 6
  • d

    Daniele B

    06/25/2021, 11:05 AM
    About creating a common project for Android and Desktop composables: Based on example provided by @darkmoon_uk https://kotlinlang.slack.com/archives/C01D6HTPATV/p1623990917153600?thread_ts=1623971327.146800&cid=C01D6HTPATV I setup the gradle file accordingly, but I still get this issue:
    i
    l
    • 3
    • 4
  • t

    TheMrCodes

    06/25/2021, 8:24 PM
    Hallo, quick question: Is it possible to set the UI Scaling (DPI) at runtime?
    z
    • 2
    • 2
  • d

    Daniele B

    06/25/2021, 8:28 PM
    I have finally added the Desktop app to the D-KMP sample: https://github.com/dbaroncelli/D-KMP-sample (featured by JetBrains in their latest KMM update) At the moment the composables for Android and Desktop are separate, in their own project directory: /*androidApp*/…../composables /*desktopApp*/…../composables They are exactly the same apart from a very small difference (the Android app uses the
    BackHandler
    composable too). All the rest is identical, as they are pure layout, with NO(!) AACViewModel/AndroidNavigation/DI dependencies whatsoever. My idea was to actually create an additional multiplatform project directory “*composables*”: /_*composables*/commonMain_ */composables*/androidMain */composables*/desktopMain just for composables shared by Android and Desktop, but I found it incredible hard, as Gradle doesn’t seem to like me. If there is anyone here who understands Gradle and the JetBrains Compose plugin very well, and has 15 minutes to spare to move the composables to their own separate project, it would be very appreciated.
    b
    u
    • 3
    • 7
  • a

    Akram Bensalem

    06/26/2021, 1:26 PM
    Is the new announcement of Windows 11 about running Android App natively without needing an emulator have any impact on the Jetpack compose ?! In another term, is this mean that in the future we can develop desktop apps just using Android development tools ?!
    :nope: 4
    c
    j
    • 3
    • 2
  • j

    Jimmy

    06/26/2021, 5:00 PM
    Is there a way to limit the number/types of components in a composable and to make the compiler complain about it (i.e. compile error, not runtime)? Say for instance, that I have my own Button implementation where I only want to allow first one Icon and then one Text, in that order.
    j
    c
    t
    • 4
    • 6
  • d

    Daniele B

    06/27/2021, 11:05 AM
    It’s very weird that multiplatform compose plugin is 
    org.jetbrains.compose
    , while the actual package is 
    androidx.compose
    . Is there a plan to make domain names more consistent?
    ➕ 11
    j
    a
    +3
    • 6
    • 16
  • d

    David Dupraz

    06/28/2021, 6:49 PM
    Hello, I have a question about rows and columns. You can see on the screenshot that I currently display a scrollable grid of cards and a fixed row of other cards. But that's really not nice. How can I make the row scrollable, following the grid ? I join a thread with the screenshot and the components organisation.
    t
    • 2
    • 5
  • a

    Akram Bensalem

    06/29/2021, 5:08 PM
    Please Help, I update kotlin plugin to 1.5.20 and I know it's not compile How to return to old 1.5.10 I tried to install it from desk using zip file but I had a lot of problems of Android bundles !!! What I have to do know ?
    k
    c
    t
    • 4
    • 10
  • j

    Justin Yue

    06/29/2021, 8:22 PM
    Hello everyone, I'm unsure as to why I am unable to run a new compose desktop project that I just made. Stacktrace in the thread, and the error message looks like this:
    Process 'command '/home/jay/.jdks/azul-15.0.3/bin/java'' finished with non-zero exit value 134
    Update: I also tried pulling the desktop template from the jetbrains-compose repository and am still getting the same error. If it helps, the Kotlin version is also 1.5.10, but I had to install it from a plugin download since I had accidentally updated from 1.4.32 to 1.5.20.
    • 1
    • 1
  • a

    Akram Bensalem

    06/29/2021, 10:48 PM
    How to select a Directory ?! Like a FileDialog ?!
    s
    • 2
    • 3
  • b

    B bis

    06/30/2021, 11:30 AM
    Hi All, I found Modifier.onPreviewKeyEvent{} is called twice on every key pressed. Is there any way to just take one callback ?
    k
    • 2
    • 1
  • n

    Nik

    06/30/2021, 6:32 PM
    Hey folks, is there any way to view the stdout/logging output of the Compose application running as a macOS .DMG executable? I seem to have some error causing the application not to launch properly when it is run as an executable but not when running it from IntelliJ
    e
    • 2
    • 2
  • j

    Javier

    07/01/2021, 9:08 AM
    latest version includes support for @Preview?
    d
    o
    • 3
    • 3
  • o

    olonho

    07/01/2021, 9:26 AM
    With
    0.5.0-build229
    we implemented new experimental feature we’d like people to experiment with and help us to get improved. Namely basic non-interactive preview. To use, switch to
    0.5.0-build229
    and add
    implementation(compose.uiTooling)
    into
    dependencies
    block. Then install IDE plugin from https://plugins.jetbrains.com/plugin/16541-compose-multiplatform-ide-support/versions/alpha/125571. Add
    @Preview
    annotation to argument-less
    @Composable
    function and you’ll have gutter like shown below. Click it and function preview could be seen in “Desktop Preview” pane of IDEA. Thanks to @alexey.tsvetkov for getting that up and running! Known issues: • put function with
    @Preview
    to file where no
    main()
    function exists, as it conflicts with run configuration. We plan to fix it soon. • preview creates stale run configurations. We plan to fix it soon. • preview pane doesn’t look eye candy • running preview requires two clicks • no automated re-running of preview on code change Anyway, share your experience, and maybe help with improvements, code is at https://github.com/JetBrains/compose-jb/tree/master/idea-plugin
    :kotlin-intensifies: 21
    🎉 33
    c
    d
    +2
    • 5
    • 18
  • o

    olonho

    07/01/2021, 10:31 AM
    Another feature of
    0.5.0-build229
    is support of linux-arm64 in Compose, i.e Ubuntu 21.04 on Raspberry Pi 400 is known to work. And due to decent graphical hardware of this machine we can run using OpenGL hardware acceleration. See video below.
    :kotlin-intensifies: 26
    🎉 7
    🦾 9
    🥧 2
    c
    • 2
    • 2
  • o

    olonho

    07/01/2021, 10:33 AM
    IMG_8410.MOV
    s
    c
    • 3
    • 3
  • r

    rcd27

    07/01/2021, 1:23 PM
    Need some help with layout: outer wrapper is
    Column
    , there are some elements in it, but I need the last one to be at the bottom of the screen. Weights working bad (good on preview, but collapses button on device): Any ideas, guys?
    c
    • 2
    • 2
  • d

    David Dupraz

    07/02/2021, 10:05 AM
    Hello, I have a problem with a list and a dropdown menu. The goal of this page is to display and configure the different player's game decks. A dropdown menu allows you to switch between decks. There is also a button to create a new deck : when clicked, a new deck is added to the list. As you can see on the video, the problem is that the new deck is added to the list... until you try to select it. When you click on it, it disappears and you can never configure it. Do you have any idea to solve that issue ? I join in a thread a video caption and a link to a small reproducer. Edit: Problem solved :)
    • 1
    • 1
  • d

    dimitar_

    07/03/2021, 10:12 AM
    After upgrading to
    0.5.0-build229
    I get an exception, because I have set
    size
    in the `Windows`’s state
    Window(onCloseRequest = {}, undecorated = true, resizable = false, state = WindowState(size = WindowSize(400.dp, 200.dp)))
    The exception:
    Trying METAL rendering...
    Exception in thread "main" java.awt.IllegalComponentStateException: The window is showing on screen.
    	at java.desktop/java.awt.Window.setLocationByPlatform(Window.java:3478)
    	at androidx.compose.ui.util.Windows_desktopKt.setLocationByPlatformSafely(Windows.desktop.kt:94)
    	at androidx.compose.ui.util.Windows_desktopKt.setPositionSafely(Windows.desktop.kt:66)
    	at androidx.compose.ui.util.Windows_desktopKt.setPositionSafely(Windows.desktop.kt:50)
    	at androidx.compose.ui.window.Window_desktopKt$Window$5$1$9.invoke(Window.desktop.kt:183)
    	at androidx.compose.ui.window.Window_desktopKt$Window$5$1$9.invoke(Window.desktop.kt:183)
    	at androidx.compose.ui.util.ComponentUpdater$UpdateScope.set(ComponentUpdater.kt:40)
    	at androidx.compose.ui.window.Window_desktopKt$Window$5$1.invoke(Window.desktop.kt:183)
    	at androidx.compose.ui.window.Window_desktopKt$Window$5$1.invoke(Window.desktop.kt:174)
    	at androidx.compose.ui.util.ComponentUpdater.update(ComponentUpdater.kt:27)
    	at androidx.compose.ui.window.Window_desktopKt$Window$5.invoke(Window.desktop.kt:174)
    	at androidx.compose.ui.window.Window_desktopKt$Window$5.invoke(Window.desktop.kt:173)
    	at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$3.invoke(AwtWindow.desktop.kt:87)
    	at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$3.invoke(AwtWindow.desktop.kt:86)
    	at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2$performUpdate$2.invoke(UpdateEffect.desktop.kt:58)
    	at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2$performUpdate$2.invoke(UpdateEffect.desktop.kt:57)
    	at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:1788)
    	at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:119)
    	at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2.invoke$performUpdate(UpdateEffect.desktop.kt:54)
    	at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2.access$invoke$performUpdate(UpdateEffect.desktop.kt:47)
    	at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2$performUpdate$1$1.invoke(UpdateEffect.desktop.kt:56)
    	at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2$performUpdate$1$1.invoke(UpdateEffect.desktop.kt:56)
    	at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$1.invokeSuspend(UpdateEffect.desktop.kt:43)
    	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$$$capture(InvocationEvent.java:316)
    	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java)
    	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)
    Any pointers? If I remove the
    state = WindowState
    everything is ok.
    j
    • 2
    • 2
  • i

    Irfan

    07/03/2021, 1:41 PM
    Hey Everyone I need to send videos stream from desktop to clients via RTMP. Is there a library which does that? actually i am just an android app developer trying to build a single application for both android and desktop thanks to “compose for desktop”.
    c
    m
    c
    • 4
    • 9
  • g

    gbaldeck

    07/03/2021, 4:06 PM
    Is
    remember
    supposed to be usable with the
    by
    keyword like below?
    var loadingState by remember { mutableStateOf(Startup.LOADING) }
    I am not able to use it most of the time and the IDE reports the error:
    Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
    In compose examples I see
    remember
    used with the
    by
    keyword, am I missing something? Here's my imports:
    import androidx.compose.runtime.mutableStateOf
    import androidx.compose.runtime.remember
    ➕ 1
    a
    y
    • 3
    • 3
  • s

    SrSouza

    07/04/2021, 3:23 AM
    👀 https://github.com/JetBrains/JWM
    👀 28
    t
    • 2
    • 1
  • s

    SrSouza

    07/04/2021, 7:01 PM
    Hi folks, I did a simple solution to listen to Ubuntu theme change for Compose for Desktop. https://gist.github.com/DevSrSouza/1b0c3840c9d0b62e8b7bba38ecaebb5f
    :kotlin-intensifies: 9
    🆒 4
    t
    • 2
    • 1
  • s

    saket

    07/05/2021, 3:56 AM
    Is it possible to create a menu bar app on macOS with compose-desktop?
    k
    • 2
    • 6
  • r

    Richard Robinson

    07/05/2021, 1:44 PM
    Is there any sort of Date Picker element in Compose for Desktop?
    s
    • 2
    • 2
  • r

    Richard Robinson

    07/05/2021, 10:37 PM
    how can i make a
    SwingPanel
    adopt a speciifc Look and Feel? I tried using
    UIManager
    to set it, but it doesn’t appear to have any effect
    k
    • 2
    • 2
  • t

    TheMrCodes

    07/06/2021, 12:15 PM
    I want to implement some Ctrl + C copy & past logic. What is the compose intended way to access selected Text or get selection Events? Ps. Why is the main class handling selection (
    SelectionRegistrar
    ) internal and not accessible for everyone?
    z
    • 2
    • 2
  • s

    Stefan Oltmann

    07/06/2021, 12:22 PM
    I updated to macOS Monterey (12) Beta and now my Compose for Desktop application is blurry. It worked fine with macOS Big Sur (11). Did someone else have this problem?
    ✅ 1
    o
    • 2
    • 7
Powered by Linen
Title
s

Stefan Oltmann

07/06/2021, 12:22 PM
I updated to macOS Monterey (12) Beta and now my Compose for Desktop application is blurry. It worked fine with macOS Big Sur (11). Did someone else have this problem?
✅ 1
o

olonho

07/06/2021, 12:40 PM
Could you please report an issue at https://github.com/JetBrains/compose-jb/issues and post a screenshot.
s

Stefan Oltmann

07/06/2021, 1:10 PM
https://github.com/JetBrains/compose-jb/issues/856
👍 1
@olonho Is that enough information to reproduce?
:tnx: 1
👍 1
o

olonho

07/06/2021, 1:35 PM
mostly, asked few additional questions in tracker
👍 1
s

Stefan Oltmann

07/06/2021, 1:44 PM
I answered to that. I can test a Swing app if you can name me a GitHub project you want me to check
IDEA itself is a Swing app, right? That looks good as you see in the screenshots attached to the issue.
o

olonho

07/06/2021, 1:49 PM
it's special one, actually, added simple example to issue
👍 1
View count: 2