Where would be the proper place to report this cra...
# compose-desktop
m
Where would be the proper place to report this crash in Compose Desktop?
a
a
Unless it’s an obvious bug, a reproducer would really help here…
According to the doc, this can only happen on systems without a mouse.
m
I would imagine the stack trace is not that bad here? Some Kotlin code is assuming a platform type coming from AWT is non-nullable, when it can be.
a
It’s easy to check whether it’s
null
. The question is what to do then.
m
this can only happen on systems without a mouse
Someone using a touch screen maybe?
a
Maybe, but I’d call it a Java bug then.
It calls
mouseDragged
and then when asked about
MouseInfo.getPointerInfo()
it says “I dunno; no mouse here” 🤡
😆 1
But yeah, I guess no harm in just ignoring the event if
MouseInfo.getPointerInfo()
is
null
.
m
Agree it's AWT being unreasonable but my understanding of the reality is that trying to report a bug in AWT will just result in it never being fixed. Ignoring the event would be much better than an NPE.
I received this crash report from 2 separate users with 2 versions of Windows 10, so it's not a unique setup.
a
Although says it’s been fixed in JDK 10
i
The question is what to do then.
@Alexander Maryanovsky We already have
ComposeScene.lastKnownPointerPosition
that was introduced for cases when AWT one is not available. I guess it will be simple fix
a
Yes, we could reimplement it without MouseInfo.getPointerInfo(). Maybe even better that way. Not 100% sure
ComposeScene.lastKnownPointerPosition
is the right thing to use, but maybe just regular drag offset.
I’m also not sure how the current implementation works if you drag the window across monitors.
Looks like the coords are local to the device
m
Dragging across monitors definitely works currently.
a
Yeah, sounds like it should
m
WindowDraggableArea has other issues in it's behavior though, like being unable to drag a window outside of a monitor - it always has to be completely visible, unlike normal OS dragging. But that's unrelated to this.
a
I think that’s a Java or a window-manager (or their combo) limitation.
m
@Alexander Maryanovsky Turns out that issue is solved in JBR: https://youtrack.jetbrains.com/issue/CMP-7793/Use-JBR-API-in-WindowDraggableArea-on-Linux
a
I’m not sure we can use JBR APIs like that.
m
My understanding is that the JBR API is safe to use and whether it's supported or not is checked at runtime, so it's not tying anything to using the JBR, just enhancing functionality when you do run on the JBR. You'd know better, of course.
a
But didn’t we already fix the crash?
m
The crash is fixed, I was referring to the other issues, like not being able to drag a window outside the screen. Like I wrote in the issue.
a
I see