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

Showing an Alert on a minimised Window will leave that Window unresponsive when it is un minimised

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      windows

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_141"
      Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 10.0.15063]

      A DESCRIPTION OF THE PROBLEM :
      If you have a main window, minimise it and then if a modal alert appears on that window, when you un minimise the main window, it will be unresponsive as the modal pop up has stolen the focus, but it is not seen anywhere on screen.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the test code supplied and minimise it, then un minimise.

      The test code adds a listener to the stage.iconifiedProperty so that when it is minimised it shows an Alert.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The behaviour on the Mac is that if you have an Alert on a minimised window, it appears irrespective of the minimised state of the main window.
      The Windows OS should behave the same.
      ACTUAL -
      When you un minimise the window, it appears totally un responsive to user interaction as the invisible Alert has got the focus.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Alert;
      import javafx.scene.control.Alert.AlertType;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;
       
      public class LockupTest extends Application
      {
          public static void main(String[] args)
          {
              launch(args);
          }
          
          @Override
          public void start(Stage primaryStage)
          {
              primaryStage.setTitle("Hello World!");
              
                            
              primaryStage.iconifiedProperty().addListener((obs, o, isIconified) ->
              {
                  if (isIconified)
                  {
                      showPopUp(primaryStage);
                  }
              });
         
              StackPane root = new StackPane();
              primaryStage.setScene(new Scene(root, 300, 250));
              primaryStage.show();
          }
          
          
          public void showPopUp(
              Stage stage)
          {
              Alert alert = new Alert(AlertType.CONFIRMATION);
              alert.initOwner(stage);
              alert.setTitle("Window Title");
              alert.setHeaderText(null);
              alert.setContentText("Foo");
              alert.showAndWait();
          }
      }
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                scfitch Stephen Fitch
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: