On Fri, 8 Jan 2021 16:04:53 GMT, Kevin Rushforth <[email protected]> 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;
> if (!PLATFORM_DRAG_GESTURE_INITIATION) {
> 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