JDK-6812298 : Dynamic GraphicsConfig changes don't work on X11 platforms
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2009-03-03
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
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.
7 b60Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
The fix for 6804747 (Ensure consistent graphicsConfig member across components hierarchy) seems to be incomplete for X11 platforms. Indeed, XComponentPeer.updateGraphicsData() only updates peer's local fields, however native resources (X11 Visual) are untouched. Unfortunately, there's no way to change Window's visual on the fly, so we'll have to re-create peer's window (or simply re-create component's peer) on every GC change.

EVALUATION Not approved for JDK 7 M3. This is a nontrivial fix to the shaped/translucent-window feature, which is not critical for M3 nor for the upcoming FX release, which will be running primarily on JDK 6.

EVALUATION Recreation of the native window implies calls to XBaseWindow: destroy(), preInit(), create(), postInit(), which actually means plain destruction/creation of the peer. Thus, the best approach is to make the ComponentPeer.updateGraphicsData() method return a boolean value indicating whether the peer needs to be recreated. The Component.setGraphicsConfig() method must check the return value and call remove/addNotify() appropriately.

EVALUATION The XComponentPeer.updateGraphicsData() method should recreate the native X11 window if the new GC belongs to a different Visual. We need to make sure this does not bring any noise like unwanted reparenting events for the child components, etc.