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

HiDPI Ubuntu Unity 16 and SystemTray icon

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 9
    • client-libs

      I have a machine with HiDPI display and Ubuntu 15.10 installed.
      Setting the scaling factor to 1, I run the following simple test:
      import java.awt.*;
      import java.awt.image.BufferedImage;

      public class TryTray {
          static TrayIcon icon;
          public static void main(String args[]) throws Exception {
              if (! SystemTray.isSupported()) {
                  System.out.println("tray is not supported");
                  return;
              }
              SystemTray tray = SystemTray.getSystemTray();
              icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), "Bimm Bomm");
              tray.add(icon);
          }
      }

      It works as expected: a black square of an icon is painted in the tray area.
      Now set the factor to 2 and rerun the test: no icon is visible any more.

      Running the test like java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java I'm getting the coordinates of the icon. Having the screen width 3000, it reports some 2500 but doesn't paint anything visible.

        1. nok.png
          14 kB
          Alexander Stepanov

            ssadetsky Semyon Sadetsky (Inactive)
            yan Yuri Nesterenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: