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

    Colton Idle

    07/06/2021, 12:31 PM
    I'm looking to introduce compose for desktop into a new project I'm working on. I have all of the code migrated and it works already. I know the age old question "Is this ready for production" is highly subjective, but my team is more curious about what types of errors this may introduce. For example, the team is a little bit afraid about using a slightly modified version of compose, but I told them it's the same compose with a few things built on top of it. I tried finding some documentation to prove that "compose for desktop IS compose, just with a few additions" but no luck on the project page or repo. 1. Am I right in my explanation? i.e. "compose for desktop IS compose, just with a few additions" 2. If so, is that written anywhere? 3. What sorts of problems can my team expect my adopting compose KMM instead of just android compose? All of these questions are with the premise that our android team has 0 intention in shipping a desktop app, we just want faster feedback loops and want to use CfD for that purpose.
    o
    i
    • 3
    • 7
  • s

    Stefan Oltmann

    07/07/2021, 8:52 PM
    I think one ugly thing is that Compose for Desktop
    Image.makeFromEncoded()
    as well as Android
    contentResolver.loadThumbnail()
    give you a
    Bitmap
    , but Compose Image needs an
    ImageBitmap
    and as far as I can see the implementation of the extension
    asImageBitmap()
    is on both worlds a really expensive conversation. 😞 Why isn't there a way to directly load an ImageBitmap if that's the needed format? 🤔
    ✅ 1
    r
    a
    • 3
    • 14
  • d

    David Dupraz

    07/08/2021, 7:33 AM
    Is there a way to execute an action when the window app (created by
    Window(...)
    function) is closed ?
    i
    • 2
    • 2
  • s

    Stefan Oltmann

    07/08/2021, 2:02 PM
    Is it already possible to change the text "MainKt" in the top left corner on MacOS so something else?
    ✅ 1
    a
    b
    +3
    • 6
    • 15
  • d

    dbaelz

    07/09/2021, 9:55 AM
    What's the current status about notifications on Linux? I've stumbled across https://github.com/JetBrains/compose-jb/issues/65, but it's more about the tray icon and some infos are older. Should the native notifications work right now? My current status: I tried it on my Ubuntu 20.04 (with gnome shell 3.36.9) and they aren't shown. Based on dbus-monitor they also aren't send to the OS. Tested it with the "old" version with
    Notifier
    and the experimental API with
    TrayState
    . Both with
    0.4.0
    and
    0.5.0-build225
    .
    fun main() = Window {
        val notifier = Notifier()
        val trayState = TrayState()
    
        MaterialTheme {
            Column {
                Button(onClick = {
                    notifier.notify("Notification Notifier", "Hello there!")
                }) { Text("Send via Notifier") }
    
                Spacer(Modifier.height(8.dp))
    
                Button(onClick = {
                    trayState.sendNotification(Notification("Notification TrayState", "Hello there!"))
                }) {
                    Text("Send via TrayState")
                }
            }
        }
    }
    o
    r
    i
    • 4
    • 4
  • s

    spierce7

    07/09/2021, 3:08 PM
    Is there any news of the jetbrains team working on compose for ios? I remember seeing something a month or so back of the compose compiler being able to work on native. I’m curious if it’s a platform that’s being worked on yet.
    b
    c
    • 3
    • 7
  • d

    Dzenan Bronja

    07/11/2021, 10:45 AM
    Hi all, I am currently working on the desktop app using Jetpack compose. One of the requirements is to get talkback reading the components (description) loud for people with sight issues. I tried to use semantics and set contentDescription as described: https://developer.android.com/jetpack/compose/accessibility, but seems like it doesn’t work for me. I am working on Mac and when I enable VoiceOver, it reads only the name of the app, when app is started or in focus, but it doesn’t focus any component from the app except the main window. I am not sure if this is a bug, or I just don’t know how to set it up, but any help is more than appreciated. If there is a working sample somewhere, or anything I can use as a reference, it would be really great. Thank you very much in advance.
    👀 4
    j
    o
    • 3
    • 3
  • t

    theapache64

    07/11/2021, 6:21 PM
    ✅ [RESOLVED] Is there any way to set min window size?
    a
    • 2
    • 10
  • a

    Angelo Rüggeberg

    07/12/2021, 6:21 AM
    Is there anything similiar to
    LocalView
    in compose Desktop ? I am trying to have a code like this in place:
    LocalView.current.let { IntSize(it.width, it.height) }
    d
    j
    • 3
    • 4
  • f

    Frank

    07/12/2021, 7:49 AM
    So is there a way to get some kind of preview of the UI without restarting it all the time?
    :thread-please: 3
    a
    c
    • 3
    • 5
  • f

    Frank

    07/12/2021, 8:43 AM
    I’ve installed the plugin but I cannot use the @Preview-Annotation nor do I see the preview icon:
    ✅ 1
    a
    • 2
    • 17
  • s

    Stefan Oltmann

    07/12/2021, 10:17 AM
    I just copied the solution for VerticalScrollbar solution wie Kotlin/Native from one of the samples and noticed that it's almost identical implemented in a lot of examples. So I wondered why this isn't part of the normal runtime? Or is this already planned? I'm talking about this:
    @Composable
    expect fun VerticalScrollbar(
        modifier: Modifier,
        scrollState: LazyListState
    )
    @Composable
    actual fun VerticalScrollbar(
        modifier: Modifier,
        scrollState: LazyListState
    ) = androidx.compose.foundation.VerticalScrollbar(
        rememberScrollbarAdapter(scrollState),
        modifier
    )
    @Composable
    actual fun VerticalScrollbar(
        modifier: Modifier,
        scrollState: LazyListState
    ) = Unit
    ✅ 1
    i
    • 2
    • 1
  • b

    Brian G

    07/13/2021, 2:04 PM
    Is it possible to use the latest jb-compose plugin without pulling in the web support? (It's not compatible with my JS target)
    o
    a
    • 3
    • 6
  • c

    Christos Malliaridis

    07/13/2021, 4:36 PM
    Hello everyone, is there a way or workaround for modifying the mouse pointer when hovering over a
    TextField
    ? I found the
    Modifier.pointerMoveFilter
    for detecting mouse hovering, but I cannot find any way for modifying the mouse cursor appearance. This would be useful for elements like `TextField`s and `Button`s but also for games and playful UIs (desktop and web) where they want to provide custom cursors.
    o
    • 2
    • 2
  • s

    Stefan Oltmann

    07/14/2021, 6:26 AM
    I'm looking for a ViewPager like https://google.github.io/accompanist/pager/ that also works for Compose for Desktop in a KMP project. Can someone recommend a solution?
    ✅ 1
    m
    • 2
    • 7
  • s

    Stefan Oltmann

    07/14/2021, 10:03 AM
    I'm confused about the Window size Parameter... I want to open my Windows in Full HD, but the Window has a completely different size... ?
    ✅ 1
    i
    • 2
    • 14
  • n

    NurBahnhof

    07/14/2021, 11:44 AM
    Hi, I have a doSomeHeavyStuffs() function triggered via onClick of a button, which I want to display a progress bar while it is running. I added of mutable isLoading state, and then write something like:
    if (isLoading)
       CircularProgressIndicator()
    Then I set isLoading before and after doSomeHeavyStuffs(). But it doesn't work because I suppose the doSomeHeavyStuffs() function is running in the UI thread. Am I supposed to run it in a separate thread? How do I do it in Jetpack Compose?
    a
    o
    • 3
    • 3
  • s

    Stefan Oltmann

    07/14/2021, 2:16 PM
    Is there a way to determine the DPI of the monitor where the Window is displayed? This gives only the scale factor:
    window.graphicsConfiguration?.defaultTransform?.scaleX
    Say I want to build a ruler composable that displays a box that's exactly 10cm long.
    ✅ 1
    a
    m
    u
    • 4
    • 15
  • d

    David Dupraz

    07/14/2021, 4:32 PM
    How do you write tests in a Compose-Desktop app ? Is it possible to simulate button clicks ?
    i
    j
    +2
    • 5
    • 4
  • j

    Joey Heck

    07/14/2021, 7:03 PM
    I'm trying to sign my mac app, and "[(My Cert Name)]: no identity found"
    n
    • 2
    • 8
  • a

    Ayfri

    07/15/2021, 6:40 AM
    Hi, I don't know why but when using the ExperimentalComposeUiAPI, when taping on the
    TAB
    key, I get this error
    Exception in thread "AWT-EventQueue-0" kotlin.UninitializedPropertyAccessException: lateinit property layoutDirection has not been initialized
    And it crashes (full stacktrace in thread)
    t
    i
    • 3
    • 4
  • n

    NurBahnhof

    07/15/2021, 10:49 AM
    How do I get access to the task createDistributable of Compose to add a dependency task? I tried
    tasks.named("createDistributable")
    in gradle build file but it's not found?
    • 1
    • 1
  • a

    Ayfri

    07/15/2021, 2:00 PM
    How can I use the
    Preview
    annotation in build 245 ?
    r
    a
    +2
    • 5
    • 14
  • p

    ppvi

    07/15/2021, 2:20 PM
    I'm running
    [compose-jb/examples/codeviewer] $ ./gradlew :desktop:run
    and getting
    Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /[...]/libskiko-linux-x64.so: libGL.so.1: cannot open shared object file: No such file or directory
    READMEs don't mention anything about requirements and couldn't find "libGL.so.1" in the repo or this channel. Quick google search doesn't help either.
    o
    • 2
    • 7
  • t

    Tim McCarthy

    07/15/2021, 7:36 PM
    I'm getting the following socket timeout exception on all HTTPS connections when I run my app from the MacOS app bundle created by
    ./gradlew createDistributable
    , but not when running it by clicking the Run button inside IDEA or from the CLI with
    ./gradlew run
    . What might be different between those environments? (fuel is in the trace for context, but I ran into similar issues with okhttp3)
    Caused by: java.net.SocketTimeoutException: Read timed out
    	java.base/sun.nio.ch.NioSocketImpl.timedRead(Unknown Source)
    	java.base/sun.nio.ch.NioSocketImpl.implRead(Unknown Source)
    	java.base/sun.nio.ch.NioSocketImpl.read(Unknown Source)
    	java.base/sun.nio.ch.NioSocketImpl$1.read(Unknown Source)
    	java.base/java.net.Socket$SocketInputStream.read(Unknown Source)
    	java.base/sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
    	java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(Unknown Source)
    	java.base/sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)
    	java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
    	java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
    	java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
    	java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    	java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    	java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    	java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    	java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    	com.github.kittinunf.fuel.toolbox.HttpClient.sendRequest(HttpClient.kt:145)
    	com.github.kittinunf.fuel.toolbox.HttpClient.doRequest(HttpClient.kt:79)
    	com.github.kittinunf.fuel.toolbox.HttpClient.executeRequest(HttpClient.kt:37)
    m
    a
    • 3
    • 4
  • x

    xxfast

    07/16/2021, 10:32 AM
    is it just me, or does the
    0.5.0-build245
    takes forever to even just gradle sync?
    a
    • 2
    • 1
  • d

    David Dupraz

    07/17/2021, 7:17 PM
    Hello, I just have a little question. I'd lke to display a column with a button above a text and a switch. But you can see on the image that result is ugly... How can I make the components stacking each other without overlap ? And how can I display the full text ? I join the code for that part in a thread. Height of the background row is 100 dp.
    d
    • 2
    • 2
  • s

    spierce7

    07/18/2021, 1:29 AM
    What version of compose desktop is for 1.5.21?
    j
    m
    • 3
    • 2
  • k

    kevindmoore

    07/18/2021, 5:37 AM
    Starting to move some of my Android Compose code over to a common code base and trying to use jetbrains compose. Can’t find a few classes like Dialog, I see some dialog specific code in org.jetbrains.compose.ui:ui-desktop. Even when I specify it as a dependency, it doesn’t seem to show
    d
    j
    • 3
    • 2
  • r

    Rafs

    07/18/2021, 4:06 PM
    Is there any way to have a live interactive preview.
    d
    c
    • 3
    • 3
Powered by Linen
Title
r

Rafs

07/18/2021, 4:06 PM
Is there any way to have a live interactive preview.
d

Dominaezzz

07/18/2021, 4:28 PM
Even Android Studio doesn't have that iirc.
c

Chris Sinco [G]

07/18/2021, 4:40 PM
Studio has the feature - it's just disabled by default in Arctic Fox. But you can always opt in to it. We are still polishing it.
r

Rafs

07/18/2021, 9:03 PM
Yes, Android Studio has a live preview where you can actually interact with the composables, it's just a bit slow to work with at the moment but it keeps getting faster with each new release of AS. Interactive preview on desktop will be much faster because the preview currently works almost instantaneously with the plugin. You just have to click it after every change which is kind of annoying.
View count: 7