Findings on JDK-8211302

Pankaj Bansal pankaj.b.bansal at
Mon May 13 13:59:57 UTC 2019

I think problem starts even before this as process_dnd_source_mouse_release is called when we release the mouse after drag and drop. But there we are not even able to initiate the dnd. If gdk_drag_context_get_selected_action(event->context) returning ZERO was the main issue, we should be able to start the drag and drop successfully. What do you think?


-----Original Message-----
From: Thiago Milczarek Sayao [mailto:thiago.sayao at] 
Sent: Monday, May 13, 2019 7:17 PM
To: openjfx-dev at
Subject: RE: Findings on JDK-8211302

It does not work because the problem happens before.

But I suspect when the  gdk_drag_context_get_selected_action(event->context) returning ZERO problem is fixed, the need of gdk_drag_drop_done() will be the problem.

De: Pankaj Bansal <pankaj.b.bansal at>
Enviado: segunda-feira, 13 de maio de 2019 10:38
Para: Thiago Milczarek Sayao; openjfx-dev at
Assunto: RE: Findings on JDK-8211302

Hello Thiago,

This solution was proposed by one of the engineers in Oracle sometime back and we have tested it. This does not seem to solve the issue. If you wish to try this, please take the patch [1], which is attached in the bug JDK-8211302. This patch neatly defines the function depending upon the gtk version. You can test this patch and let us know if you could make this work.



-----Original Message-----
From: Thiago Milczarek Sayao [mailto:thiago.sayao at]
Sent: Monday, May 13, 2019 6:59 PM
To: openjfx-dev at
Subject: Findings on JDK-8211302


I have been looking into JDK-8211302.

Did not find a solution, but the problem is because gdk_drag_context_get_selected_action(event->context) is returning ZERO. That's also why the cursor does not update on the drop location. Subsequent events do not get fired to complete the drop, because it falls on the abort code below:

static void process_dnd_source_mouse_release(GdkWindow *window, GdkEventButton *event) {


    if (gdk_drag_context_get_selected_action(get_drag_context())) {
        gdk_drag_drop(get_drag_context(), GDK_CURRENT_TIME);
    } else {
        gdk_drag_abort(get_drag_context(), GDK_CURRENT_TIME);
        /* let the gdk_drag_abort messages handled before finish */
        gdk_threads_add_idle((GSourceFunc) dnd_finish_callback, NULL);

I also suspect this will be needed, and it was introduced in GDK 3.20:

gdk_drag_drop_done(get_drag_context(), TRUE)

One solution is to check the version on build, other is to bundle the GTK lib (which makes it more safe to GDK changes).


More information about the openjfx-dev mailing list