-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
jfx11
-
x86_64
-
linux
ADDITIONAL SYSTEM INFORMATION :
Linux Mint 19.1
JDK 11.0.1 and JavaFx 11.0.1 (From Gluon)
A DESCRIPTION OF THE PROBLEM :
This is clarification ask by Pankaj Bansal for the issue:JDK-8211302.
Sorry, I wasn't precise enough the first time.
The problem is that it is no longer possible to trigger a dragg and drop in linux.
We can see this problem because when the drag and drop starts, the mouse icon does not change.
It is also not detected by another JavaFx stage.
I have created another test code to test dragg and drop between 2 JavaFx stage.
Do not hesitate to contact me by email if you need more details.
REGRESSION : Last worked in version 10.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the source code and try to dragg from the stage with a button to the second stage.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Firstly: "dragg detected" when the dragg start.
Secondly: "dragg over" when the cursor of the mouse enters in the second stage.
Thirdly: "dragg dropped with: It works" when the user releases the mouse button.
ACTUAL -
We can only see the first step but nothing when the mouse is over the second stage or when the drop is done.
---------- BEGIN SOURCE ----------
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.scene.layout.Pane;
import javafx.stage.Stage;
public class Fx11draggError extends Application {
@Override
public void start(Stage stage) throws Exception {
Button button = new Button("Dragg from here to the other window");
button.setOnDragDetected(e -> {
System.out.println("dragg detected");
ClipboardContent content = new ClipboardContent();
content.putString("It works");
button.startDragAndDrop(TransferMode.MOVE).setContent(content);
e.consume();
});
stage.setScene(new Scene(button, 300, 200));
stage.show();
Stage stage2 = new Stage();
Pane pane = new Pane();
pane.setOnDragOver(e -> {
System.out.println("dragg over");
e.acceptTransferModes(TransferMode.MOVE);
e.consume();
});
pane.setOnDragDropped(e -> {
System.out.println("dragg dropped with: " + e.getDragboard().getString());
e.consume();
});
pane.setPrefSize(200, 200);
stage2.setScene(new Scene(pane, 200, 200));
stage2.show();
}
public static void main(String[] args) {
launch();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
use -Djdk.gtk.version=2
FREQUENCY : always
Linux Mint 19.1
JDK 11.0.1 and JavaFx 11.0.1 (From Gluon)
A DESCRIPTION OF THE PROBLEM :
This is clarification ask by Pankaj Bansal for the issue:
Sorry, I wasn't precise enough the first time.
The problem is that it is no longer possible to trigger a dragg and drop in linux.
We can see this problem because when the drag and drop starts, the mouse icon does not change.
It is also not detected by another JavaFx stage.
I have created another test code to test dragg and drop between 2 JavaFx stage.
Do not hesitate to contact me by email if you need more details.
REGRESSION : Last worked in version 10.0.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the source code and try to dragg from the stage with a button to the second stage.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Firstly: "dragg detected" when the dragg start.
Secondly: "dragg over" when the cursor of the mouse enters in the second stage.
Thirdly: "dragg dropped with: It works" when the user releases the mouse button.
ACTUAL -
We can only see the first step but nothing when the mouse is over the second stage or when the drop is done.
---------- BEGIN SOURCE ----------
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.scene.layout.Pane;
import javafx.stage.Stage;
public class Fx11draggError extends Application {
@Override
public void start(Stage stage) throws Exception {
Button button = new Button("Dragg from here to the other window");
button.setOnDragDetected(e -> {
System.out.println("dragg detected");
ClipboardContent content = new ClipboardContent();
content.putString("It works");
button.startDragAndDrop(TransferMode.MOVE).setContent(content);
e.consume();
});
stage.setScene(new Scene(button, 300, 200));
stage.show();
Stage stage2 = new Stage();
Pane pane = new Pane();
pane.setOnDragOver(e -> {
System.out.println("dragg over");
e.acceptTransferModes(TransferMode.MOVE);
e.consume();
});
pane.setOnDragDropped(e -> {
System.out.println("dragg dropped with: " + e.getDragboard().getString());
e.consume();
});
pane.setPrefSize(200, 200);
stage2.setScene(new Scene(pane, 200, 200));
stage2.show();
}
public static void main(String[] args) {
launch();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
use -Djdk.gtk.version=2
FREQUENCY : always
- duplicates
-
JDK-8211302 DragAndDrop no longer works with GTK3
- Resolved