Open YektaDev opened 1 year ago
Could you please share what Compose version did you use? And a small reproducing sample if you have it handy?
I tried Compose 1.3.0 (macOs for now, I'll try on windows 11 later):
fun main() = application {
Window(onCloseRequest = ::exitApplication, undecorated = true, resizable = true) {
//...
}
}
It didn't crash when I tried to drag the corners of a window.
I didn't have a bare minimum reproducible code, so I created an empty Compose project, updated the dependencies, and tried to reproduce the error. It didn't happen the first time, but after some trial and error, I was able to find the condition to reprouduce it and can confirm it happens with:
import androidx.compose.material.Text
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
fun main() = application {
Window(onCloseRequest = ::exitApplication, undecorated = true, resizable = true) {
Text("Hello, NPE!")
}
}
Kotlin 1.8.0 Compose 1.3.0 JVM Target 17 Windows 11 21H2 (build 22000.1455)
This only happens when I have a secondary monitor connected (it's smaller than the primary monitor in pixels). When the app is inside the primary (bigger) monitor and I try to drag the right corner to the very end of it, the exception happenes.
Since I posted the reproducer alonside the condition + all details to reproduce, shall we change the labels?
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Running Windows 11, I get a
java.lang.NullPointerException
while trying to drag the right corner of an undecorated window to the very right end of my screen. Here's the stacktrace:I checked the source and the solution seems to be:
A null check at
MouseInfo.getPointerInfo().location
is likely to solve the issue.