RFR: 8333919: dragViewOffsetX/dragViewOffsetY are ignored for the dragView image
Lukasz Kostyra
lkostyra at openjdk.org
Fri Aug 9 08:13:16 UTC 2024
On Thu, 8 Aug 2024 12:35:59 GMT, Lukasz Kostyra <lkostyra at openjdk.org> wrote:
> When fixing [JDK-8233955](https://bugs.openjdk.org/browse/JDK-8233955) offset calculation was left out, which made Dragboard offset API not work on macOS.
>
> This change fixes this mistake. Now drag image should be properly offset.
I did not realize that Windows/macOS behavior was matched in this regard, so I'll use Windows as reference for further testing. Thanks!
I agree offsets should be flipped (with `-=` rather than `+=`) so that is working well. I also removed the centering of the drag image, so now both shift directions and offset origin match Windows.
However, from my initial testing, it seems like macOS prefers the mouse cursor to be always within the drag image bounds. As an example, `DndTest.java` defined the Y offset equal to -30. While the drag image is initially offset correctly, macOS immediately "snaps" it back so that the mouse cursor stays within the drag image bounds. This seems to be a platform-specific behavior though (Windows keeps the offset as we define it). I'll do some more experiments and see if that can be remedied somehow, but for now I doubt it.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1532#issuecomment-2277396417
More information about the openjfx-dev
mailing list