JDK-8122536 : [Quantum] JavaFX does not paint correctly when a window opens while the screen is locked
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 7u45,8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-11-28
  • Updated: 2015-06-17
  • Resolved: 2013-12-02
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.
JDK 8
8Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8122936 :  
Description
JavaFX does not paint correctly when a window opens while the screen is locked. The problem is reproducible on JavaFX 2.2.x and 8.0.

Steps to reproduce:
1) Launch the application (attached).
2) Click the spawn window button.
3) Lock the screen (on windows, WindowsKey + L).
4) Wait about 8 seconds.
5) Unlock the screen.
6) Observe that the spawned window has opened, but nothing is painted!
7) Mouse over the spawned window content.
8) Observe that the window paints correctly.
Comments
Fix verified and released http://hg.openjdk.java.net/openjfx/8/graphics/rt/rev/446894e7355b
02-12-2013

Ok Felipe, push it.
02-12-2013

+1 webrev.00 looks good to me to go into FX 8.
02-12-2013

I can't call myself an expert in Quantum painters yet, but looking at the code I don't think the fix can bring any harm. So I'm OK with the fix if it resolves the issue.
29-11-2013

I agree. Further is seems that isDeviceReady() can only return false on Windows. If this was not the case, we'd need to discuss this further.
29-11-2013

I prefer not to have the platform check unless proven necessary. That is, as long as it is not harmful on other platforms, it is best to not check the platform.
29-11-2013

Based on the Vadim's comment above: isDeviceReady() returns false only on Windows when device lost is detected. The problem is only reproducible on Windows platform. I was not able to reproduce it on Linux and Mac. I think it is not necessary to add platform check but if you insist, I will update the fix. What is your opinion?
29-11-2013

There are actually two additional similar code pieces, when the presentable.prepare and presentable.present return false we call entireSceneNeedsRepaint(), that's actually where I've picked up the fix for RT-33028. isDeviceReady return false only on Windows in case of device lost.
28-11-2013

Me too but let's find out when the code runs on the various platforms.
28-11-2013

The fix looks fine to me, too (and I would just as soon do it "as is" without the platform check). I also added Felipe and Anthony to the watch list, since this is in Quantum.
28-11-2013

The fix is very simple ��� great! Thoughts: 1) Under what other circumstances will !factory.isDeviceReady() return true? 2) The code is shared on all platforms but the problem only happens on Windows - are we sure of this?? - to be extra safe, we could put in a platform test (to be taken out in 8u20)
28-11-2013

Evaluation: PresentingPainter detects the device lost event using factory.isDeviceReady() call. If the device is lost, PresentingPainter invokes entireSceneNeedsRepaint() only for NOT dirty scenes. However, if the scene is created while the screen is locked, (i.e. the device is lost), entireSceneNeedsRepaint() will not be called since the scene is already marked as dirty. As a result the scene will not be painted at all, because after returning from the render it is removed from the list of dirty scenes in PaintCollector. Suggested fix: If device lost event takes place, PresentingPainter should call entireSceneNeedsRepaint() for a scene. Webrev link: http://cr.openjdk.java.net/~dmarkov/RT-34557/webrev.00/
28-11-2013