RFR: 8165749: java.lang.RuntimeException: dndGesture.dragboard is null in dragDrop
Kevin Rushforth
kcr at openjdk.java.net
Fri Jan 8 16:07:58 UTC 2021
On Wed, 6 Jan 2021 17:40:43 GMT, Jose Pereda <jpereda at openjdk.org> wrote:
>> modules/javafx.graphics/src/main/java/javafx/scene/Scene.java line 3788:
>>
>>> 3786: //old gesture ended and new one started
>>> 3787: gestureStarted = true;
>>> 3788: if (!PLATFORM_DRAG_GESTURE_INITIATION && Scene.this.dndGesture == null) {
>>
>> This will prevent the creation of the new `DndGesture`, but we will still clear the PDR targets. Have you confirmed that this is the desired behavior? It seems reasonable, since we also clear it on a mouse move, but wanted to get your take on it.
>
> This is really an edge case. There can be two gestures at once, an existing one (i.e from TouchPad), with its full drag information, that hasn't finished yet, and a new mouse one.
>
> Having a single `dndGesture` object for both events seems wrong. But having a list/array of events for such scenario seems overkill.
>
> Somehow some information from one or the other event might get lost or mixed up. The PDR targets are not required for the initial touch event, and we prevent the RTE, so I'd say this is a reasonable non-intrusive fix.
In looking at it more closely, I think it might be better to avoid setting `gestureStarted` if there is already a drag gesture in process (started via dragEnter). Maybe something like this?
if (Scene.this.dndGesture == null) {
//old gesture ended and new one started
gestureStarted = true;
if (!PLATFORM_DRAG_GESTURE_INITIATION) {
Scene.this.dndGesture = new DnDGesture();
}
clearPDREventTargets();
}
-------------
PR: https://git.openjdk.java.net/jfx/pull/372
More information about the openjfx-dev
mailing list