If I create a javafx dialog using the following method:
public static void showDialog(Event event) throws IOException {
dialogStage = new Stage();
GridPane grid = (GridPane) Start.createLoader().load(Start.class.getResource("file.fxml").openStream());
dialogStage.setScene(new Scene(grid));
dialogStage.setTitle("Title");
dialogStage.initModality(Modality.WINDOW_MODAL);
dialogStage.initOwner(((Node) event.getSource()).getScene().getWindow());
dialogStage.showAndWait();
}
the ower window moves in case it is maximized. This also happens if I use:
Modality.APPLICATION_MODAL
It works if I combine:
dialogStage.initModality(Modality.WINDOW_MODAL);
dialogStage.initOwner(primaryStage.getOwner());
but in this case the owner window is not blocked. I want my dialog showing up on a maximized window without moving it. The maximized window should be blocked while the dialog is open. How can I do this?
Btw. I am using java 8 and javafx on linux.
Tanks!
As a workaround for Linux it's possible to use this trick: