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

Text size is twice bigger under GTK L&F on Gnome with HiDPI enabled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 8, 9
    • client-libs
    • Linux Ubuntu: 14.04
      Gnome: 3.9.90
      JDK 1.8.0_40-ea

      Steps to reproduce:

      Run the code:
      -----------------------
      import javax.swing.*;
      import com.sun.java.swing.plaf.gtk.GTKLookAndFeel;

      public class GnomeHiDPITest {

          public static void main(String[] args) {
              SwingUtilities.invokeLater(() -> {
                  try {
                      UIManager.setLookAndFeel(new GTKLookAndFeel());
                      JFrame frame = new JFrame();
                      frame.setSize(100, 100);
                      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                      JMenuBar menuBar = new JMenuBar();
                      menuBar.add(new JMenu("Test 1"));
                      menuBar.add(new JMenu("Test 2"));
                      frame.setJMenuBar(menuBar);
                      frame.setVisible(true);
                  } catch (UnsupportedLookAndFeelException ex) {
                      throw new RuntimeException(ex);
                  }
              });
          }
      }
      -----------------------

      - Enable HiDPI
      > gsettings set org.gnome.desktop.interface scaling-factor 2

      The text menu size is enlarged.

      Note that under Metal L&F the text size is not changed.

            abhiscxk Abhishek Kumar
            alexsch Alexandr Scherbatiy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: