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

Show dialog triggered by mouse event on maximized window causes window to move

    XMLWordPrintable

Details

    • x86_64
    • linux

    Description

      ADDITIONAL SYSTEM INFORMATION :
      This has happened continuously since at least JFX 11/Java 11, and continues in 14 (the latest I can test at the moment).

      openjdk version "14.0.2" 2020-07-14
      OpenJDK Runtime Environment (build 14.0.2+12)
      OpenJDK 64-Bit Server VM (build 14.0.2+12, mixed mode)

      I'm using openbox as a display manager. There are least two other reports across the internet: https://stackoverflow.com/questions/24519668/javafx-maximized-window-moves-if-dialog-shows-up
      I've confirmed it doesn't happen on Windows.

      A DESCRIPTION OF THE PROBLEM :
      In a maximized window, if a button click causes a dialog to appear the parent window will be effectively un-maximized and moved halfway across the screen. The parent window remains this way after the dialog is closed.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the code below and press the button

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Parent window should not move or stop being maximized
      ACTUAL -
      Parent window moves

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Alert;
      import javafx.scene.control.Button;
      import javafx.stage.Modality;
      import javafx.stage.Stage;

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

        public void start(Stage stage) throws Exception {
          Button button = new Button();
          button.setOnAction(e -> {
            Alert alert = new Alert(Alert.AlertType.INFORMATION);
            alert.initOwner(stage);
            alert.initModality(Modality.WINDOW_MODAL);
            alert.show();
          });
          stage.setScene(new Scene(button));
          stage.setMaximized(true);
          stage.show();
        }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


      Attachments

        Activity

          People

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: