RFR: 8333919: dragViewOffsetX/dragViewOffsetY are ignored for the dragView image [v2]
Jose Pereda
jpereda at openjdk.org
Mon Aug 12 17:24:40 UTC 2024
On Mon, 12 Aug 2024 16:22:17 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> By the way, this is how you can disable the cancel animation:
>>
>>
>> diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassDraggingSource.m b/modules/javafx.graphics/src/main/native-glass/mac/GlassDraggingSource.m
>> index 50a79cabf6..373537f24e 100644
>> --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassDraggingSource.m
>> +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassDraggingSource.m
>> @@ -40,6 +40,7 @@
>>
>> - (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context
>> {
>> + session.animatesToStartingPositionsOnCancelOrFail = NO;
>> // The Command key masks out every operation other than NSDragOperationGeneric. We want
>> // internal Move events to get through this filtering so we copy the Move bit into the
>> // Generic bit and treat Generic as a synonym for Move.
>>
>>
>> I'm still in favour of this native animation, as opposed to the Windows case that doesn't have it. This can be a separated issue as well (unifying the animation in all platforms).
>
> I wanted to chime in, thought it might be unrelated:
>
> In the context of a docking framework, it is impossible to disable the cancel animation. We should have a way to disable it. The use case is when the user drags and drops a tab/pane outside of the dockable windows. In this case a new window should appear at the drop location, without the drag image animated back to the start position.
>
> Another thing that is impossible is to control the drag image: sometimes one needs a scaled icon, sometimes one wants the full content.
>
> These two issues basically prevent implementing a docking framework via DnD, one needs to use other solution, for example
> https://github.com/andy-goryachev/FxDock
I'm not sure if I follow, but about the cancel animation, do you mean that is not possible to disable it on macOS? Have you tested `session.animatesToStartingPositionsOnCancelOrFail`?
As for the image, `DragBoard::setDragView` allows you setting any image that you need for the drag gesture, or am I missing something?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1532#discussion_r1714139069
More information about the openjfx-dev
mailing list