JDK-8119109 : Mac: When a window first shows up it shows black content, resulting in unpleasant visual flash
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2011-09-07
  • Updated: 2022-05-07
  • Resolved: 2011-10-17
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
fx2.0.2Fixed
Related Reports
Relates :  
Relates :  
Description
Run any JavaFX program on a Mac platform, such as HelloRectangle. This black (blank) screen before showing the actually content is even more pronounce if we uses the -Dprism.order=j2d pipe. 
Comments
Verified on 2.0.2b08, macosx.6.8. There is a gray background and that seems better.
16-11-2011

RT-17464 covers a fix in Quantum code to support synchronous painting.
17-10-2011

Removing the setBackgroundColor:[NSColor blackColor] call only makes the initial flashing color gray, but does not eliminate the flashing itself. I believe the issue here is as follows. Upon showing the window, native OS sends a view the drawRect: request which Glass translates into: 1) ViewEvent.REPAINT event through the View.EventHandler.handleViewEvent(). 2) Pen.paint() method is called. For 1), Quantum schedules a repaint job but doesn't execute it immediately (see GlassViewEventHandler.handleViewEvent(), and QuantumRenderer.liveResizeRenderJob()). Not performing the painting operation synchronously means that the OS has no choice but to show the background of the window when it initially shows up. As for the 2), PrismPen,paint() implementation is empty. So, until Quantum is able to provide synchronous painting as a reaction to the REPAINT event, the flash cannot be eliminated. The question is: do we want to replace the unpleasant black flashing background with an equally unpleasant gray one? If yes, the fix in Glass may be a one-liner that removes the setBackgroundColor call. If not, then this JIRA should be re-dispatched to Graphics and be properly fixed in Quantum.
03-10-2011

This is most probably due to unconditional calling of _setTransparent function in GlassWindow.m when we create any window. If the window isn't supposed to be transparent, this function explicitly sets a black background to the window, which probably causes the issue.
03-10-2011