JDK-8218479 : JTextPane display issue with GTKLookAndFeel
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u202,9,10,11,12,13
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2019-02-05
  • Updated: 2019-09-26
  • Resolved: 2019-02-15
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 11 JDK 12 JDK 13 JDK 8 Other
11.0.4-oracleFixed 12.0.2Fixed 13 b09Fixed 8u221Fixed openjdk8u222Fixed
Related Reports
Relates :  
Relates :  
Description
Running any Swing app having a JTextPane component with GTK L&F (-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel) leads to component not being correctly rendered - please see the attached screenshots
Comments
Fix Request This issue solves GTK 3+ compatibility problem. Patch applies cleanly to 11u (and I see 11.0.4-oracle), and to 8u with reshuffling (and I see 8u221/222). Original test works fine after the patch, and looks wrong before the patch. 8u requires -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Djdk.gtk.version=3 to reproduce. The risk is minimal.
18-03-2019

Removing 'tck-red-12' from this bug as GTK+ 3.20 and above are claimed not supported in JDK 12
14-02-2019

This issue is release noted by JDK-8218469
14-02-2019

Starting GTK 3.20 the TEXT_PANE rendering was changed so TEXT_PANE should be opaque now. The patch to fix: --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Mon Feb 04 21:42:47 2019 +0100 +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Fri Feb 08 13:25:31 2019 -0800 @@ -739,7 +739,8 @@ region == Region.TOOL_BAR_DRAG_WINDOW || region == Region.TOOL_TIP || region == Region.TREE || - region == Region.VIEWPORT) { + region == Region.VIEWPORT || + region == Region.TEXT_PANE) { return true; } if (!GTKLookAndFeel.is3()) { @@ -747,8 +748,7 @@ region == Region.FORMATTED_TEXT_FIELD || region == Region.PASSWORD_FIELD || region == Region.SPINNER || - region == Region.TEXT_FIELD || - region == Region.TEXT_PANE) { + region == Region.TEXT_FIELD) { return true; } }
12-02-2019

This is P1 TCK-RED issue for JDK 12 GA release. The fix is in progress.
08-02-2019

I have attached the sample code and corresponding rendering in Default look and feel and GTK look and feel to demonstrate the difference.
07-02-2019