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

    Konyaco

    11/11/2021, 2:28 PM
    This SVG cannot be rendered correctly. But works well if translate to Android XML.
    Image(
        modifier = Modifier.size(93.dp, 24.dp),
        painter = painterResource("logo_text.xml"),
        contentDescription = null,
        colorFilter = ColorFilter.tint(Color.White)
    )
    logo_text.svglogo_text.xml
    ✅ 1
    o
    • 2
    • 1
  • i

    iamthevoid

    11/11/2021, 6:18 PM
    I had console app and wanted to try to wrap it into compose desktop. I did it. On Linux it work as expected. I launched it from Intellij Idea on windows virtual machine and it worked to. But when i built it (tried both: msi and exe) it simple do nothing when i try run blocking operations, where RxJava is using. In these places i try to download data from internet (retrofit) and put in into SQLite db (exposed). Looks like operations just hang.
    o
    • 2
    • 2
  • s

    Sean Proctor

    11/12/2021, 1:47 AM
    Does anyone have experience with intercepting keypresses from the numpad? I'm returning false from
    Modifier.onPreviewKeyEvent
    , but the keypress is still getting through to the
    BasicTextField
    • 1
    • 2
  • k

    Kebbin

    11/12/2021, 4:45 AM
    Hello, I want to setup a GUI with 3 Columns nested in 1 Row. I need the center column only to be shrinking/growing when resizing the program window, with the left & right columns remaining fixed. Do I need to set the centre column width to a calculated value of
    programSize - (leftSize + rightSize)
    ? Or is there a way to do it with Layout priorities? Thanks!
    a
    • 2
    • 4
  • e

    elect

    11/12/2021, 12:03 PM
    what's the corresponding version for desktop of
    implementation "androidx.compose.material:material-icons-extended:$compose_version"
    o
    i
    • 3
    • 6
  • j

    Jonathan Moore

    11/12/2021, 9:53 PM
    Is it possible in Compose to set a window to always be on top? (electron equivalent: https://www.electronjs.org/docs/latest/api/browser-window#winsetalwaysontopflag-level-relativelevel)
    k
    • 2
    • 1
  • k

    Kebbin

    11/14/2021, 3:53 AM
    Hello! How can I create perspective effects when rotating objects away from the screen in Compose? https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/GraphicsLayerScope#cameraDistance() This doc says "... A short distance may cause much more perspective distortion upon rotation, ..." but I haven't been able to achieve any perspective effect at all by manipulating this value, on an Image() item. Thanks!
    i
    d
    • 3
    • 36
  • a

    Akram Bensalem

    11/14/2021, 12:56 PM
    Is there any template for a project "Android, Desktop and Web compose" like the official templates here I find difficulties to add Web compose to multiplatform template, Any help, please?
    c
    • 2
    • 1
  • j

    Jakob K

    11/15/2021, 1:01 PM
    When I am adding the compose dependency to a (resolvable) Gradle configuration (
    includeImplementation
    is my custom configuration) as follows:
    includeImplementation(compose.desktop.currentOs)
    and then trying to resolve the dependencies of this configuration
    includeImplementation.resolvedConfiguration.firstLevelModuleDependencies
    I am getting the following error
    Caused by: org.gradle.internal.component.AmbiguousConfigurationSelectionException: Cannot choose between the following variants of org.jetbrains.compose.foundation:foundation:1.0.0-beta5:
      - debugRuntimeElements-published
      - desktopRuntimeElements-published
      - releaseRuntimeElements-published
    How can I choose one of these variants and avoid this exception?
    j
    • 2
    • 2
  • e

    elect

    11/15/2021, 3:36 PM
    I'm testing the latest snapshot, but Gradle cant seem to find it
    plugins {
        kotlin("jvm") version embeddedKotlinVersion
        id("org.jetbrains.compose") version "v1.0.0-beta6-dev462"
    }
    repositories {
        google()
        mavenCentral()
        maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
    }
    org.gradle.internal.exceptions.LocationAwareException: Build file '/home/elect/IdeaProjects/app1/build.gradle.kts' line: 5
    Plugin [id: 'org.jetbrains.compose', version: 'v1.0.0-beta6-dev462'] was not found in any of the following sources:
    - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
    - Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.compose😮rg.jetbrains.compose.gradle.plugin:v1.0.0-beta6-dev462')
    Searched in the following repositories:
    Google
    Gradle Central Plugin Repository
    maven(https://maven.pkg.jetbrains.space/public/p/compose/dev)
    Am I missing something obvious? Snapshot is there, maybe some problem with the marker?
    • 1
    • 1
  • j

    joakim

    11/15/2021, 6:23 PM
    Hey there. Is there some magic trick to get Desktop Preview to work? • I have the
    Compose Multiplatform IDE Support
    installed • I have a block of code
    @Preview
    @Composable
    fun SomePreview() {
        MaterialTheme {
            SomeScreen(someParam: boolean)
        }
    }
    But I get a forever spinning progressbar in the desktop preview window saying "Rendering preview" Am I missing something here?
    d
    • 2
    • 2
  • e

    elect

    11/15/2021, 9:19 PM
    is the toolbox
    JetBrains Toolbox 1.22.10685, Ubuntu 21.10 21.10 (Linux 5.13.0-21-generic)
    already ported to Compose? Because over there tray menu and notifications on Ubuntu are perfect, native-style. The ones from the tutorials are completely different instead, example
    c
    • 2
    • 2
  • d

    darkmoon_uk

    11/15/2021, 10:44 PM
    Has anyone hit upon a low-effort solution to parse Markdown into Compose's
    AnnotatedString
    ? *Erik Hellman*'s article discusses doing this; wondering if any fuller formed alternatives sprang up in the last year.
    r
    m
    z
    • 4
    • 7
  • a

    Ayfri

    11/16/2021, 4:11 PM
    Does Compose Desktop works with Kotlin 1.6 ?
    h
    • 2
    • 1
  • a

    Ayfri

    11/16/2021, 4:33 PM
    Hi, I have a weird problem, I'm trying to set an app as fullscreen and show only a single image, but when I set the window placement to
    FullScreen
    , the image doesn't show up, and if I don't the image is there, I'm using latest build 464 and Kotlin 1.5.31 Also when it is in fullscreen the app is freezed and I can't close it unless going into the Task Manager (from Windows)
    j
    • 2
    • 1
  • j

    joakim

    11/16/2021, 8:04 PM
    My desktop app looks wildly different on my MacBook monitor compared to my secondary monitor, which I'm guessing is just attributed to them having very different densities. But there must be a way to handle this so that you can move your app across displays whilst keeping the appearance in size/scale fairly similar? What's the trick that I'm missing?
    k
    r
    i
    • 4
    • 5
  • s

    spierce7

    11/17/2021, 1:54 AM
    Has anyone gotten a compose desktop application running on a chromebook? Would it be the same as running it on a linux machine?
    g
    e
    • 3
    • 3
  • j

    Javier

    11/17/2021, 3:01 PM
    Is this the right way to remove highlight errors for Composables that are using
    ExperimentalMaterialApi
    ? The project is KMP, I know the
    sourceSets.all.lanaguageSettings
    is the multiplatform way, but both are not working for me, not sure what is the issue but I can only remove the error by adding the
    OptInt(...)
    to the composable function
    tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
        kotlinOptions.freeCompilerArgs += "-opt-in=androidx.compose.material.ExperimentalMaterialApi"
    }
    
    kotlin {
        android()
        jvm()
    
        sourceSets {
            all {
                languageSettings.optIn("androidx.compose.material.ExperimentalMaterialApi")
            }
            ...
        }
    }
    l
    e
    • 3
    • 11
  • v

    v79

    11/19/2021, 8:12 AM
    Where do I go to learn about replacing the default styles in compose desktop? Ideally to get rid of that awful purple and do something a bit more platform-native?
    k
    f
    +2
    • 5
    • 13
  • a

    Aaron Yoder

    11/19/2021, 8:18 AM
    Does anyone have experience building an RPM package via WSL2? I am getting an error that generates a completely blank log file, but it seems to me that maybe jlink is missing? I have built deb packages using Ubuntu on WSL before without issue. I have fakeroot and JDK 17 installed on OpenSUSE Tumbleweed.
    • 1
    • 1
  • j

    Javier

    11/19/2021, 9:13 AM
    I have seen 1.6.0 support was merged, will there be a dev version with it today?
    k
    h
    l
    • 4
    • 5
  • s

    Slackbot

    11/19/2021, 3:32 PM
    This message was deleted.
    s
    • 2
    • 1
  • s

    spierce7

    11/19/2021, 4:26 PM
    Does anyone know of a work around for this? https://github.com/JetBrains/compose-jb/issues/1115
    r
    • 2
    • 2
  • r

    Ryan Mitchener

    11/19/2021, 7:31 PM
    Does anyone know of a good way to profile compose rendering performance to find components causing issues? Ideally this would include a flame graph of each component that was recomposed and how long it took (very similar to react dev tools).
    👀 1
    b
    • 2
    • 1
  • s

    spierce7

    11/20/2021, 6:30 PM
    If I’m using a
    LazyColumn
    that’s being continuously updated with new items at the bottom, how do I keep the scroll locked at the bottom?
    m
    m
    z
    • 4
    • 5
  • a

    Aaron Yoder

    11/21/2021, 12:05 PM
    I decided to install an RPM distro on actual hardware to try to build an rpm package and I am getting the same error as the message I sent above, empty error log file.
    • 1
    • 2
  • h

    Humphrey

    11/21/2021, 10:19 PM
    Is it possible to use room database with Compose Desktop? My gradle is not able to download the dependencies from maven.google.com. (2.3.0)
    b
    k
    +3
    • 6
    • 8
  • b

    bartosz.malkowski

    11/22/2021, 12:02 PM
    Is there a way to execute an action when Notification will be clicked?
    o
    r
    • 3
    • 2
  • g

    Goregius

    11/22/2021, 4:20 PM
    There still seems to be an issue with DirectX rendering with G-Sync. When using Nvidia G-Sync and DirectX, and when there is rendering taking place (cursor moving over a new button for example causing an animation), the app drops fps significantly. This can be fixed by setting the rendering mode to OPENGL or SOFTWARE but this isn't ideal. I assume this is a Skiko/Skia issue. This issue is also apparent in the Jetbrains Toolbox app which uses Compose for Desktop, I can fix the issue with changing the rendering mode as well.
    • 1
    • 1
  • r

    Ryan Mitchener

    11/22/2021, 7:19 PM
    Anyone have any good way to require a minimum window size for the application but still allow it to be resizable?
    m
    c
    • 3
    • 4
Powered by Linen
Title
r

Ryan Mitchener

11/22/2021, 7:19 PM
Anyone have any good way to require a minimum window size for the application but still allow it to be resizable?
m

Mitchell Syer

11/22/2021, 7:33 PM
Something like this should work
fun main() = application {
    Window(onCloseRequest = ::exitApplication, title = "AppName") {
        LaunchedEffect(Unit) {
            window.minimumSize = // minimum size dimension
        }
    }
}
👀 1
r

Ryan Mitchener

11/22/2021, 7:36 PM
Thanks! I can’t believe I didn’t see that -_-
c

Chris Sinco [G]

11/22/2021, 11:28 PM
So that should resize the dialog on launch if no initial size is set?
r

Ryan Mitchener

11/23/2021, 2:48 PM
@Chris Sinco [G] Yes. I use intrinsic sizing with resizable. If you set the window.minimumSize in a
LaunchedEffect
though you will get some resize stutter on launch, So I do this instead until there is a better workaround:
fun main() = application {
    val minWindowSize = remember(density) { Dimension((1280 * density).toInt(), (768 * density).toInt()) }

    Window {
        if (window.minimumSize != minWindowSize) mainWindow.minimumSize = minWindowSize
    }
}
View count: 10