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

Opening a dialog causes the main stage to lose its maximized state in linux

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      CentOS 7, OpenJDK 18

      A DESCRIPTION OF THE PROBLEM :
      After upgrading from OpenJFX 20 to 21 I have noticed that opening any dialog, like for example an Alert, will cause the main stage/window to snap out of its maximized state, if it has been maximized. I have only observed this on Linux/CentOS, on Windows 10 the behaviour is as expected.

      I can reliably reproduce this issue with the given test program, which just opens a window and shows an Alert when pressing a button.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      - Run the example code
      - Maximize the window
      - Press the button to show an Alert

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The Alert should show up and the window should remain unaffected
      ACTUAL -
      The Alert shows up but the window is no longer maximized

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.*;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

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

          @Override
          public void start(Stage primaryStage) {
              ToggleButton buttonAbout = new ToggleButton("Show Dialog");
              buttonAbout.setOnAction(event -> {
                  Alert alert = new Alert(Alert.AlertType.INFORMATION);
                  alert.show();
              });

              HBox hbox = new HBox();
              hbox.getChildren().add(buttonAbout);

              Scene scene = new Scene(hbox);
              primaryStage.setScene(scene);
              primaryStage.setTitle("Main Window");
              primaryStage.show();
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


        1. TestApplication.java
          0.8 kB
        2. Ubuntu_Capture1.PNG
          Ubuntu_Capture1.PNG
          99 kB
        3. Ubuntu_Capture2.PNG
          Ubuntu_Capture2.PNG
          113 kB
        4. Windows_Capture1.PNG
          Windows_Capture1.PNG
          23 kB
        5. Windows_Capture2.PNG
          Windows_Capture2.PNG
          40 kB

            tsayao Thiago Sayao
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: