Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8324684

Resizable alerts are displayed too small initially in Gnome

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx21
    • javafx
    • None
    • Fedora release 38 (Thirty Eight)

      GNOME Shell 44.2

      javafx-sdk-21.0.2

      Using the following test program:

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Alert;
      import javafx.scene.control.Alert.AlertType;
      import javafx.scene.control.Button;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class HelloWorld extends Application {
      public static void main(String[] args) {
      launch(args);
      }

      @Override
      public void start(Stage primaryStage) {
      primaryStage.setTitle("Hello World!");
      Button btn = new Button();
      btn.setText("Say 'Hello World'");
      btn.setOnAction(e -> {
      Alert alert = new Alert(AlertType.INFORMATION);
      alert.setTitle("Information Dialog");
      alert.setHeaderText(System.getProperty("javafx.runtime.version") + ": Look, an Information Dialog, it may contain quite the long text.");
      alert.setContentText("I have a great message for you! This dialog works in every Linux desktop environment, except Gnome");
      alert.setResizable(true);
      alert.showAndWait();
      });
      StackPane root = new StackPane();
      root.getChildren().add(btn);
      Scene scene = new Scene(root, 1024, 600);
      primaryStage.setScene(scene);
      primaryStage.show();
      }
      }


      When the "Hello World" button is clicked the alert is displayed in a window sized 200x200 px (plus title bar).

      Strangely enough this only happens when using Gnome. Other window managers (like KDE, fluxbox, i3) do not show that behaviour.

      It also only happens in JavaFX 21. When using older versions of JavaFX the dialog is displayed as expected.

        1. Gnome_JavaFX_20.png
          Gnome_JavaFX_20.png
          27 kB
        2. Gnome_JavaFX_21.png
          Gnome_JavaFX_21.png
          20 kB
        3. Gnome_JavaFX_21ea17.png
          Gnome_JavaFX_21ea17.png
          27 kB
        4. Gnome_JavaFX_21ea21.png
          Gnome_JavaFX_21ea21.png
          27 kB
        5. Gnome_javaFX_21ea23.png
          Gnome_javaFX_21ea23.png
          20 kB
        6. Gnome_JavaFX_22ea16.png
          Gnome_JavaFX_22ea16.png
          20 kB

            tsayao Thiago Sayao
            rlichten Robert Lichtenberger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: