Hello Emmanaele,


Thanks for replying and sorry if I sounded unreasonable to go and check the 
issue. I was referring to look at the issue and reproducer for the issue. 



In Ubuntu 16.04 (gtk3.18) all works fine for in JavaFX. 

For Ubuntu 18.04 (gtk3.20 or later), the dnd stops working. I have found that 
we are not getting any calls from gtk side. I mean gtk is not calling the event 
callback function. I see that there is only one DragEnter event, one DragMotion 
event and then one DragEnd event. Whereas with gtk 3.18, we get many 
DragMotionm events which is what supposed to happen. 


Below is a sample code, which can be used to easily see the issue. It is using 
the JavaFX for dnd.


I was hoping to get hands on some dnd native sample/demo which works fine with 
gtk3.20 or later. But if you are saying that nothing has changed, so I have to 
see what makes our code stop working from gtk3.20



//Sample Fx11draggError.java


import javafx.application.Application; 

import javafx.scene.Scene; 

import javafx.scene.control.Button; 

import javafx.scene.input.ClipboardContent; 

import javafx.scene.input.TransferMode; 

import javafx.stage.Stage; 

public class Fx11draggError extends Application{ 


public void start(Stage stage) throws Exception { 

               Button button = new Button("test"); 

               button.setOnDragDetected(e -> { 

                              System.out.println("Drag detected");

                              ClipboardContent content = new 

                              content.putString("It works"); 




        button.setOnDragOver((ev)-> {System.out.println("Drag over"); 

        button.setOnDragDropped((ev)-> {System.out.println("Drag end"); 

        button.setOnDragDone((ev)-> {System.out.println("Drag done"); 

       stage.setScene(new Scene(button, 200, 200)); 



public static void main(String[] args) { 







From: Emmanuele Bassi [mailto:eba...@gmail.com] 
Sent: Monday, April 15, 2019 5:26 PM
To: Pankaj Bansal
Cc: gtk-app-devel-list list
Subject: Re: gtk3 drag and drop sample/demo


On Mon, 15 Apr 2019 at 12:45, Pankaj Bansal via gtk-app-devel-list <HYPERLINK 
"mailto:gtk-app-devel-list@gnome.org"gtk-app-devel-list@gnome.org> wrote:


I am working with OpenJDK JavaFX dev group and we are facing some problems with 
drag and drop functionality with gtk3.20 or later. You can have a look at the 
bug for more information https://bugs.openjdk.java.net/browse/JDK-8211302. It 
will be great if someone can point out any big change done with respect to drag 
and drop from gtk3.20.


First of all, it's kind of rude to ask people to go to a random bug tracker and 
ask for a code review without stating what the issue is.


Can you explain what issues are you experiencing?


I am looking for a sample/demo for drag and drop functionality using gtk3. I 
can see that there is one demo at [1], but it is not compatible with gtk3 as it 
is using gtk4 specific structs and functions. I am not able to find any other 
working demo/sample working with gtk3. It would be great if anyone can point to 
me to something useful.


The drag and drop code in GTK 3 hasn't really changed from the 2.x days, and 
has been substantially reworked for GTK 4.


The old drag and drop tutorial may be of help: HYPERLINK 






[@] ebassi [@HYPERLINK 
gtk-app-devel-list mailing list

Reply via email to