Monotone
Monotone

Reputation: 43

Window jiggles on JavaFX window when opening/closing dialog on Linux

This is weird. I have a JavaFX application when run on Linux the window jiggles whenever you open and close another dialog. I notice that the maximize button is removed from the window when the dialog is displayed then added back when it is closed. I haven’t found anyone else complaining about this. I’ve included a dead simple application to show that I’m not doing anything remotely unusual. This happens whenever displaying any type of Dialog. Any thoughts?

Sorry for the terrible image, but the built-in screen recorder didn't actually record the jiggle.

I’m running java 21.0.3+9, JavaFX 19.0.2.1 on Ubuntu 22.04.

    public class Test extends Application
    {
       @Override
       public void start( Stage stage )
      {
          Button button = new Button( "Test" );
          button.setOnAction( e -> {
             Alert alert = new Alert(Alert.AlertType.NONE, "Hello", ButtonType.CLOSE );
             alert.initOwner( stage.getScene().getWindow() );
             alert.showAndWait();
          } );
          VBox vbox = new VBox();
          vbox.getChildren().add( button );
          stage.setScene( new Scene( vbox, 600, 800 ) );
          stage.show();
       }
    }

This app runs fine on Windows (no jiggle), but not on Linux. Swing works fine on this machine and I’m not seeing this behavior anywhere else. Any JavaFX app I run does this. This is a stock install of Ubuntu. No customization of the OS and the apps I run on it were direct downloads (like IntelliJ Idea), meaning I haven't altered the OS via any package managers or command-line tools.

Upvotes: 4

Views: 81

Answers (0)

Related Questions