JDK-8158466 : Sometimes parent stage resizes when clicked while window modal child stage is visible
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 8u91,9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2016-05-30
  • Updated: 2018-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux radeks-VirtualBox 4.2.0-36-generic #42~14.04.1-Ubuntu SMP Fri May 13 17:27:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
Ubuntu is running inside VirtualBox and on physical machine.

A DESCRIPTION OF THE PROBLEM :
Sometimes, when the main stage shows a dialog (child window modal stage), clicking on the parent window resizes it.
The test application has a combination of scene and stage sizes that I can reproduce this most often with.
In my application I don't set the stage size, which causes it to be resized to 1x29 pixels in size, however I couldn't reproduce this exact case in the test application.
This may be related to https://bugs.openjdk.java.net/browse/JDK-8088236
however my problem occurs on local system (both VirtualBox and physical machine).
What I also observed is that the modal stage size is also different between runs of the test application (the height may or may not include the height of window title bar), and occasionally it's not even correctly centered on the parent stage.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the test application.
2. Click on the primary stage.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Nothing happens.
ACTUAL -
The primary stage sometimes resizes.

REPRODUCIBILITY :
This bug can be reproduced occasionally.

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Modality;
import javafx.stage.Stage;

public class TestMain extends Application {

    public static void main(final String... args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        VBox root = new VBox();
        root.getChildren().add(new Label("Primary Stage"));
        Scene scene = new Scene(root, 200, 200);

        primaryStage.setScene(scene);

        primaryStage.setHeight(200);
        primaryStage.setWidth(200);
        primaryStage.setResizable(true);

        primaryStage.show();

        primaryStage.widthProperty().addListener((observable, oldValue, newValue) -> {
            System.out.println("Primary stage width changed from " + oldValue + " to " + newValue);
        });
        primaryStage.heightProperty().addListener((observable, oldValue, newValue) -> {
            System.out.println("Primary stage height changed from " + oldValue + " to " + newValue);
        });

        Platform.runLater(() -> {
            Stage secondStage = new Stage();
            secondStage.initOwner(primaryStage);

            VBox secondRoot = new VBox();
            secondRoot.getChildren().add(new Label("Secondary Stage"));
            Scene secondScene = new Scene(secondRoot);

            secondStage.setScene(secondScene);

            secondStage.setHeight(100);
            secondStage.setWidth(100);

            secondStage.initModality(Modality.WINDOW_MODAL);

            secondStage.show();
        });
    }

}

---------- END SOURCE ----------


Comments
Checked this for 8u0, 8u92, 9 ea+119 and 9 ea+120 on Ubuntu (Linux) and could confirm the issue as reported by the submitter. Steps to Reproduce: Run the attached test case (TestMain.java) with the JDK version. Test Result: ######### OS: Ubuntu Linux 64 bit JDK: 8u0 b132 : Fail 8u92 b31 : Fail 9ea+119 : Fail 9ea+120 : compiles fine but could not able to execute the test case O/P (9ea+120) ******************* abhijit@abhijit-VirtualBox:/media/sf_ora/ji/javafx$ javac TestMain.java abhijit@abhijit-VirtualBox:/media/sf_ora/ji/javafx$ java TestMain libGL error: pci id for fd 5: 80ee:beef, driver (null) libGL error: core dri or dri2 extension not found libGL error: failed to load driver: vboxvideo java: symbol lookup error: /media/sf_ora/java/jdk-9-ea+120_linux-x64_bin/lib/amd64/libglass.so: undefined symbol: _Z36g_settings_schema_source_get_defaultv abhijit@abhijit-VirtualBox:/media/sf_ora/ji/javafx$ ============================================================================================== It looks like a similar issue of JDK-8088236. Therefore, moving this issue over JDK for dev team's assessment.
02-06-2016