Marc
04/06/2024, 1:24 AMalwaysOnTop
property on Window
, but it seems like every time I modify it my window moves a bit down and right. Here is example code that shows off this behaviour (at least on Windows, where I am currently working):
fun main() = application {
val coroutineScope = rememberCoroutineScope()
val alwaysOnTop by remember {
flow {
while (true) {
emit(true)
delay(2.seconds)
emit(false)
delay(2.seconds)
}
}.shareIn(coroutineScope, SharingStarted.Lazily)
}.collectAsState(false)
Window(
title = "Test",
state = WindowState(width = 1200.dp, height = 900.dp),
alwaysOnTop = alwaysOnTop,
onCloseRequest = ::exitApplication
) {
Text("hi")
}
}
Visually this behaviour reminds me of the default behaviour on Windows when opening multiple windows after each other, where they are spaced apart a bit so they don't 100% overlap each other. Is the window getting recreated or something of the sort? Is there a way to disable this behaviour?Alexander Maryanovsky
04/06/2024, 6:01 AMMarc
04/06/2024, 10:53 AM