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

app window blinks when the app is activated

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      java 18.0.1.1
      javafx-sdk-16 through 18.0.1 (latest)
      macOS 12.3.1 (21E258)
      iMac (Retina 5K, 27-inch, 2020)
      72 GB 2133 MHz DDR4
      3.8 GHz 8-Core Intel Core i7
      AMD Radeon Pro 5500 XT 8 GB

      A DESCRIPTION OF THE PROBLEM :
      A visible flash occurs when the application is first activated.

      I have a screen movie to show this.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Build a simple app.
      2. Run the app from a Terminal window (not from inside Intellij IDEA, where it works) using e.g.
         /Library/Java/JavaVirtualMachines/jdk-18.0.1.1.jdk/Contents/Home/bin/java
      3. Activate (switch to) the app by clicking it in the Dock or by clicking the app’s title bar or anywhere in the window

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The window should not “flash” when the app is first activated.
      ACTUAL -
      The window “flashes”, meaning that it goes completely transparent briefly then works normally.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.event.EventHandler;
      import javafx.geometry.Insets;
      import javafx.scene.Cursor;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.input.MouseEvent;
      import javafx.scene.layout.Background;
      import javafx.scene.layout.BackgroundFill;
      import javafx.scene.layout.CornerRadii;
      import javafx.scene.layout.Pane;
      import javafx.scene.paint.Color;
      import javafx.scene.shape.Circle;
      import javafx.stage.Stage;

      public class FlashingProblem extends Application {

        @Override
        public void start(Stage primaryStage) {
          var root = new Pane();
          // The following line does not work around the bug.
          root.setBackground(new Background(new BackgroundFill(Color.AZURE, CornerRadii.EMPTY, Insets.EMPTY)));
          primaryStage.setScene(new Scene(root, 400, 350));
          primaryStage.show();
        }

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

      CUSTOMER SUBMITTED WORKAROUND :
      1. Run from inside Intellij IDEA
      2. Use javafx-sdk-15.0.1 or earlier

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: