JDK-6691181 : SunToolkit.disableBackgroundErase() needs to support more components
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-04-19
  • Updated: 2008-04-29
  • Resolved: 2008-04-29
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.
6u10 b23Fixed 7Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Investigation has revealed that the root cause of certain flickering with applets (for example, during some applet resizes, and when resizing the "gray box painter" responsible for painting a custom image or the Java logo during applet loading) is due to the AWT's native background erasure.

The SunToolkit.disableBackgroundErase(Canvas) method added for 6333613 needs to have an overloaded variant added, SunToolkit.disableBackgroundErase(Component), which should take effect for any applicable component and ignore others. Currently this seems to mean any component with a WCanvasPeer or XCanvasPeer, which includes the EmbeddedFrame subclasses.

SUGGESTED FIX http://sa.sfbay.sun.com/projects/deployment_data/6u10/6691181.0

EVALUATION During investigation of Java Plug-In bug 6691182 (Flickering of gray box painter during applet resizes), it was discovered that the root cause was the native background repainting of the Canvas and other AWT components using the WCanvasPeer or XCanvasPeer. For this reason, it is necessary to generalize the Sun-private mechanisms added in 6333613 and 6558510 to work with more types of Components (in particular, Canvas, Panel and Window). An overloaded variant of SunToolkit.disableBackgroundErase() taking a Component rather than a Canvas as argument has been added. The implementation has been restructured to work on both the Windows and X11 platforms. On X11 platforms, the disabling of the background erase had to be supported earlier, because if it was a requirement that the peer had to be created, then it would be too late, because once XSetBackground is called during peer creation, the flickering will be apparent. There is no test case for this specific bug due to the difficulty of writing a standalone test case. A test case will be provided for the related bug 6691182. The changes have been verified on the Windows and Solaris platforms with the test case for 6691182.