You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While dragging it's not possible to receive any other mouse move events, I traced the issue back to the MouseMotionListener that is being registered. mouseMoved will not be called while dragging is active, mouseDragged is called in that case.
I currently have the following temporary workaround:
funmain() =Window(title ="Porygen", size =IntSize(600, 1000)) {
Root()
// Get the wrapped ComposeLayerval window =AppWindowAmbient.current!!.window.contentPane.getComponent(0)
// Get the original motion listenerval listener = window.mouseMotionListeners.first()
window.addMouseMotionListener(object:MouseMotionListener {
overridefunmouseDragged(e:MouseEvent) {
// Also trigger mouse moved so we don't get locked// out of other pointer events while dragging
listener.mouseMoved(e)
}
overridefunmouseMoved(e:MouseEvent) {
}
})
}
The text was updated successfully, but these errors were encountered:
Difference between Swing drag and move events:
- move events are fired only in the bounds of the window and when mouse isn't pressed
- drag events are fired when mouse is pressed and can be fired even if the mouse outside of the pressed window
Currently we treat drag events only as Modifier.pointerInput events.
And move events only as Modifier.onPointerMove events
This CL allows:
- handle any mouse move/drag events with Modifier.pointerInput
- use mouse hover (Modifier.onPointerMove) with the pressed mouse button
But after this some components should handle Modifier.onPointerMove(onExit={}) differently.
For example, we need to keep scrollbar highlighted when we move mouse outside of the scrollbar.
Before this CL this was handled automatically, because we didn't send move events when we drag the mouse.
But it shouldn't be handled automatically, developer should explicitly write this logic
(keep scrollbar highlighted when we drag it)
Fixes:
JetBrains/compose-multiplatform#134JetBrains/compose-multiplatform#530
Change-Id: If510840c2c7e4bf2e192f9990e5a05cec592635a
Test: manual ./gradlew :compose:desktop:desktop:desktop-samples:run1 -Pandroidx.compose.multiplatformEnabled=true
Test: drag Scrollbar and move mouse outside
Now both Swing's mouseDragged/mouseMoved events are treated as Modifier.pointerInput and Modifier.pointerMove events (we plan to integrate pointerMove onExit/onEnter into pointerInput in the future).
Affects:
0.2.0-build127
While dragging it's not possible to receive any other mouse move events, I traced the issue back to the
MouseMotionListener
that is being registered.mouseMoved
will not be called while dragging is active,mouseDragged
is called in that case.I currently have the following temporary workaround:
The text was updated successfully, but these errors were encountered: