Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8203627

Swing applications with JRadioButton and JCheckbox fail to render correctly when using GTK3 and the GTK L&F

    Details

    • Subcomponent:
    • Resolved In Build:
      b09
    • CPU:
      x86_64
    • OS:
      linux_ubuntu

      Backports

        Description

        ADDITIONAL SYSTEM INFORMATION :
        AMD64, Ubuntu 18.04 Bionic, OpenJDK 10.0.1.

        Please note that while Debian name their OpenJDK 10 packages as openjdk-10 in Ubuntu Bionic they are named openjdk-11 in order to provide an easier upgrade path to user then OpenJDK 11 is released.

        A DESCRIPTION OF THE PROBLEM :
        Swing/AWT applications using the GTK L&K render incorrectly under GTK3. If GTK2 is used then they render as expected.

        This has been reported in Ubuntu [1] and Debian [2], but as reported in [1] the Oracle JDK 10 is also affected.

        Debian and Ubuntu both package OpenJDK 10.0.1, additionally we also apply the patch for JDK-8198649 thus making GTK3 the default.

        Ubuntu and Debian render correctly when forcing GTK2 by setting -Djdk.gtk.version=2.

        Oracle's JDK 10 also show the same problems when forcing GTK3 usage by setting -Djdk.gtk.version=3.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Install the JRE and Demo packages and run the FileChooserDemo under GTK3 and GTK2.

        Under Debian:
        $ sudo apt-get install default-jre openjdk-10-demo
        $ java -jar /usr/share/doc/openjdk-10-jre-headless/demo/jfc/FileChooserDemo/FileChooserDemo.jar

        Now run it using GTK2 for the correct rendering:
        $ java -Djdk.gtk.version=2 -jar /usr/share/doc/openjdk-10-jre-headless/demo/jfc/FileChooserDemo/FileChooserDemo.jar

        On Ubuntu packages OpenJDK 10.0.1 under binary packages named as openjdk-11:
        $ sudo apt-get install default-jre openjdk-11-demo
        $ java -jar /usr/share/doc/openjdk-11-jre-headless/demo/jfc/FileChooserDemo/FileChooserDemo.jar

        Now run it using GTK2 for the correct rendering:
        $ java -Djdk.gtk.version=2 -jar /usr/share/doc/openjdk-11-jre-headless/demo/jfc/FileChooserDemo/FileChooserDemo.jar

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Checkbox and the selection box element should be rendered correctly.
        ACTUAL -
        The GTK3 based rendering is failing to draw the checkbox and the selection box element correctly.

        ---------- BEGIN SOURCE ----------
        The FileChooserDemo from OpenJDK.
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Setting -Djdk.gtk.version=2 forces the system to use GTK2 libraries which render correctly, but the user might not have those installed as Debian and Ubuntu are removing all dependencies on GTK2 in order to complete the move to GTK3.

        FREQUENCY : always


          Attachments

          1. Ubuntu_18.04_GTK3.png
            Ubuntu_18.04_GTK3.png
            117 kB
          2. Ubuntu_18.04_GTK2.png
            Ubuntu_18.04_GTK2.png
            128 kB
          3. GTKbug.png
            GTKbug.png
            328 kB
          4. 7_003.png
            7_003.png
            45 kB

            Issue Links

              Activity

                People

                • Assignee:
                  pbansal Pankaj Bansal
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  12 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: