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

Gtk: [Screen, Linux] screen dpi cannot be determined

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.1
    • Fix Version/s: 7-pool
    • Component/s: javafx
    • Labels:
    • Environment:

      2.1.0b08
      Linux Ubuntu 10.04 2.6.32-33-generic

      Description

      In linux DPI cannot be detected:

      import java.util.Iterator;
      import javafx.application.Application;
      import javafx.stage.Screen;
      import javafx.stage.Stage;

      public class JavaFX extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              for (Iterator<Screen> it = Screen.getScreens().iterator(); it.hasNext();) {
                  Screen s = it.next();
                  System.out.println("Screen : " + s);
                  System.out.println("DPI : " + s.getDpi());
              }
          }
      }

      Output:
      run:
      Screen : javafx.stage.Screen@7150461bbounds:Rectangle2D [minX = 0.0, minY=0.0, maxX=1440.0, maxY=900.0, width=1440.0, height=900.0] visualBounds:Rectangle2D [minX = 0.0, minY=0.0, maxX=1440.0, maxY=900.0, width=1440.0, height=900.0] dpi:0.0
      DPI : 0.0

        Attachments

          Activity

            People

            Assignee:
            radko Radko Najman (Inactive)
            Reporter:
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: