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
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.