JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.88k stars 1.15k forks source link

WindowDraggableArea has a problem (jumps to bottom on click) #3709

Open mahozad opened 11 months ago

mahozad commented 11 months ago

Describe the bug Occasionally, clicking on an undecorated window that has a custom title bar (using WindowDraggableArea) causes the window to jump to bottom.

This happens every so often and may not be so easy to reproduce.

Here are two times that I reproduced the problem:

https://github.com/JetBrains/compose-multiplatform/assets/29678011/c5aa04a9-b6b4-4002-a736-48629fdac4bc

https://github.com/JetBrains/compose-multiplatform/assets/29678011/0f61fbc7-a619-4401-87c9-0fe346bc4012

Affected platforms

Versions

To Reproduce

import androidx.compose.foundation.window.WindowDraggableArea
// ...

fun main() = application {
    Window(
        resizable = false,
        undecorated = true,
        onCloseRequest = ::exitApplication
    ) {
        WindowDraggableArea(
            modifier = Modifier
                .fillMaxWidth()
                .height(30.dp)
                .background(Color.Yellow)
        ) {
            Icon(
                imageVector = Icons.Outlined.Close,
                contentDescription = null,
                modifier = Modifier.clickable(onClick = ::exitApplication)
            )
        }
    }
}
dima-avdeev-jb commented 11 months ago

Created repository with reproducer: https://github.com/dima-avdeev-jb/issue-3709/tree/main

@mahozad Can you please check this bug in my repository again?

mahozad commented 11 months ago

@dima-avdeev-jb Yes. I reproduced the bug with your repository in my Windows 11.

okushnikov commented 1 month ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.