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

[macos]StageStyle.UNIFIED doesn't work with transparent scene

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx21, jfx25
    • javafx

      If we run below test program, background is filled with black color.

      import javafx.application.*;
      import javafx.scene.*;
      import javafx.scene.control.*;
      import javafx.scene.layout.*;
      import javafx.scene.paint.*;
      import javafx.stage.*;

      public class TestUnifiedStage extends Application {

          @Override
          public void start(Stage primaryStage) throws Exception{
              boolean allowsUnified = Platform.isSupported(ConditionalFeature.UNIFIED_WINDOW);
              System.err.println("Unified windows " + (allowsUnified ? "ARE" : "are NOT") + " supported");
              primaryStage.setTitle("Hello World");
              primaryStage.initStyle(StageStyle.UNIFIED);
              final VBox vBox = new VBox();
              //vBox.setAlignment(Pos.CENTER);
              vBox.setStyle("-fx-background-color: transparent");
              vBox.getChildren().add(new Label("Hello World"));
              
              // remove this and it works!
              primaryStage.setScene(new Scene(vBox, Color.TRANSPARENT));
              primaryStage.show();
          }


          public static void main(String[] args) {
              launch(args);
          }
      }

      Looks like the issue identified in JDK-8095040 has resurfaced. Issue can be seen in JFX25 and i have also checked that issue happens in JFX21.
      If we run the same program in 8u431 it draws properly.

        1. 8u431.png
          8u431.png
          23 kB
        2. jfx21.png
          jfx21.png
          23 kB
        3. jfx25.png
          jfx25.png
          19 kB

            arapte Ambarish Rapte
            jdv Jayathirth D V
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: