-
Notifications
You must be signed in to change notification settings - Fork 945
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Desktop: Treat Swing drag and move mouse events as Compose move events
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#134 JetBrains/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
- Loading branch information
Showing
4 changed files
with
24 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters