-
Bug
-
Resolution: Unresolved
-
P4
-
jfx20, jfx21, jfx24
-
generic
-
windows
ADDITIONAL SYSTEM INFORMATION :
Ubuntu 20.04.6 LTS
JavaFX 20
OpenJDK 22.0.1+8-16
A DESCRIPTION OF THE PROBLEM :
Run the provided code. You will see that on changing transparent stage Y position and height the bottom side is shaking, see <link> The same problem with the right side while changing X position and width. Besides, you will see the same problem if you use undecorated stage.
It is not possible to test the provided code in javafx 21-24 because of theJDK-8344372 .
Because of this bug it is not possible to use a custom stage in JavaFX as the bug doesn't let to implement the window resizing using top/left border. Similar toJDK-8344372, this bug prevents performing the most basic operations with Stage.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code. Click on the stage and move mouse up and bottom.
---------- BEGIN SOURCE ----------
public class NewMain extends Application {
public static void main(String args[]){
launch(args);
}
private Stage stage;
private double initialY;
private double initialHeight;
private double initialMouseY;
@Override
public void start(Stage stage) throws Exception {
this.stage = stage;
var root = new VBox();
root.setStyle("-fx-background-color: yellow");
root.setOnMousePressed(e -> onMousePressed(e));
root.setOnMouseDragged(e -> onMouseDragged(e));
var scene = new Scene(root, 600, 400);
stage.initStyle(StageStyle.TRANSPARENT);
stage.setScene(scene);
stage.show();
}
private void onMousePressed(MouseEvent e) {
this.initialY = stage.getY();
this.initialHeight = stage.getHeight();
this.initialMouseY = e.getScreenY();
}
private void onMouseDragged(MouseEvent e) {
var d = this.initialMouseY - e.getScreenY();
stage.setHeight(this.initialHeight + d);
stage.setY(this.initialY - d);
}
}
---------- END SOURCE ----------
Ubuntu 20.04.6 LTS
JavaFX 20
OpenJDK 22.0.1+8-16
A DESCRIPTION OF THE PROBLEM :
Run the provided code. You will see that on changing transparent stage Y position and height the bottom side is shaking, see <link> The same problem with the right side while changing X position and width. Besides, you will see the same problem if you use undecorated stage.
It is not possible to test the provided code in javafx 21-24 because of the
Because of this bug it is not possible to use a custom stage in JavaFX as the bug doesn't let to implement the window resizing using top/left border. Similar to
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code. Click on the stage and move mouse up and bottom.
---------- BEGIN SOURCE ----------
public class NewMain extends Application {
public static void main(String args[]){
launch(args);
}
private Stage stage;
private double initialY;
private double initialHeight;
private double initialMouseY;
@Override
public void start(Stage stage) throws Exception {
this.stage = stage;
var root = new VBox();
root.setStyle("-fx-background-color: yellow");
root.setOnMousePressed(e -> onMousePressed(e));
root.setOnMouseDragged(e -> onMouseDragged(e));
var scene = new Scene(root, 600, 400);
stage.initStyle(StageStyle.TRANSPARENT);
stage.setScene(scene);
stage.show();
}
private void onMousePressed(MouseEvent e) {
this.initialY = stage.getY();
this.initialHeight = stage.getHeight();
this.initialMouseY = e.getScreenY();
}
private void onMouseDragged(MouseEvent e) {
var d = this.initialMouseY - e.getScreenY();
stage.setHeight(this.initialHeight + d);
stage.setY(this.initialY - d);
}
}
---------- END SOURCE ----------