RFR: 8165749: java.lang.RuntimeException: dndGesture.dragboard is null in dragDrop [v2]

Jose Pereda jpereda at openjdk.java.net
Sat Jan 9 16:54:10 UTC 2021

On Fri, 8 Jan 2021 16:04:53 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> 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;
>             Scene.this.dndGesture = new DnDGesture();
>         }
>         clearPDREventTargets();
>     }

Makes sense, I'll change it, but avoiding two nested if expressions.


PR: https://git.openjdk.java.net/jfx/pull/372

More information about the openjfx-dev mailing list