title: JavaFX misreports my screen sizes on Linux. Is this a bug?
body: <p>The following code uses <code>java.awt.GraphicsDevice</code> and <code>javafx.stage.Screen</code> to get the screen sizes in pixels.   JavaFX seems to get it wrong under Linux, as shown below (but correct under Windows 7).  I would be interested to know if anyone else has experienced the same apparent bug.</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.stage.*;
  import java.awt.*;
  
  public class DisplayCheck extends Application {
  
      static int getScreenWidthViaAWT(int screenNum) {
          GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[screenNum];
          return gd.getDisplayMode().getWidth();
      }
  
      static int getScreenHeightViaAWT(int screenNum) {
          GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[screenNum];
          return gd.getDisplayMode().getHeight();
      }
  
      static int getScreenWidthViaJavaFX(int screenNum) {
          return (int)Screen.getScreens().get(screenNum).getVisualBounds().getWidth();
      }
  
      static int getScreenHeightViaJavaFX(int screenNum) {
          return (int)Screen.getScreens().get(screenNum).getVisualBounds().getHeight();
      }
  
      public static void main(String[] args) {
  
          int w0 = getScreenWidthViaAWT(0);
          int h0 = getScreenHeightViaAWT(0);
          int w1 = getScreenWidthViaAWT(1);
          int h1 = getScreenHeightViaAWT(1);
  
          System.out.println ("\n\nScreen sizes from java.awt.GraphicsDevice:\n\nScreen 0: " + w0 + " x " + h0 + "\nScreen 1: " + w1 + " x " + h1);
  
          w0 = getScreenWidthViaJavaFX(0);
          h0 = getScreenHeightViaJavaFX(0);
          w1 = getScreenWidthViaJavaFX(1);
          h1 = getScreenHeightViaJavaFX(1);
  
          System.out.println ("\n\nScreen sizes from javafx.stage.Screen:\n\nScreen 0: " + w0 + " x " + h0 + "\nScreen 1: " + w1 + " x " + h1);
  
          launch(args);
      }
  
      public void start (Stage stage) {
          System.exit(0);     
      }
   } 
  </code></pre>
  
  <p>On my system (Ubuntu MATE), JavaFX misreports the heights of both my laptop screen and my external monitor as 718 pixels.   AWT gets it right. The results are as follows:</p>
  
  <pre><code>john@jlaptop2:/java$ javac DisplayCheck.java
  john@jlaptop2:/java$ java DisplayCheck
  
  
  Screen sizes from java.awt.GraphicsDevice:
  
  Screen 0: 1024 x 768
  Screen 1: 1920 x 1080
  
  
  Screen sizes from javafx.stage.Screen:
  
  Screen 0: 1920 x 718
  Screen 1: 1024 x 718
  john@jlaptop2:/java$
  </code></pre>