JDK-8139117 : Undecorated stage flickers on resize
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u60
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2015-10-06
  • Updated: 2015-11-11
  • Resolved: 2015-11-11
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Intel HD Graphics 4000

A DESCRIPTION OF THE PROBLEM :
Most likely this is a duplicate of this bug: https://bugs.openjdk.java.net/browse/JDK-8093776
But I was not able to add any comment or description.

An undecorated stage flickers in a way, that it draws a black background for the whole client area. The black background gets overdrawn by the actual scene contents immediately, but sometimes it's visible for a short time. This causes the flickering. Flickering increases as the window grows in size.

There is no flickering if the stage is decorated.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the following source code on Windows.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No flickering visible as with decorated stages.
ACTUAL -
Flickering

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class StageFlicker extends Application {
    public void start(Stage primaryStage) throws Exception {
	primaryStage.initStyle(StageStyle.UNDECORATED);
	
	Label label = new Label("Drag me to resize");
	AnchorPane.setRightAnchor(label, 0.0);
	AnchorPane.setBottomAnchor(label, 0.0);
	label.setOnMouseDragged(e -> {
	    primaryStage.setWidth(e.getScreenX() - primaryStage.getX());
	    primaryStage.setHeight(e.getScreenY() - primaryStage.getY());
	});
	
	primaryStage.setScene(new Scene(new AnchorPane(label)));
	primaryStage.setWidth(400);
	primaryStage.setHeight(300);
	primaryStage.show();
    }

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

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

CUSTOMER SUBMITTED WORKAROUND :
No workaround found


Comments
Update: if I set the window position at (0,0) then as I stretch the window to be really big I can see an occasional flicker.
09-10-2015

I don't see this on my Windows 7 machine, but possibly it might be reproducible on a slower machine.
09-10-2015

The testcase included in this bug may help to reproduce JDK-8093776. Moving this over to JDK for the development team's evaluation.
08-10-2015