--- old/src/java.desktop/unix/classes/sun/awt/X11GraphicsConfig.java 2015-11-06 02:13:08.842200925 -0500 +++ new/src/java.desktop/unix/classes/sun/awt/X11GraphicsConfig.java 2015-11-06 02:13:08.682120929 -0500 @@ -133,7 +133,7 @@ /** * Return the graphics device associated with this configuration. */ - public GraphicsDevice getDevice() { + public X11GraphicsDevice getDevice() { return screen; } @@ -256,7 +256,20 @@ * For image buffers, this Transform will be the Identity transform. */ public AffineTransform getDefaultTransform() { - return new AffineTransform(); + double scale = getScale(); + return AffineTransform.getScaleInstance(scale, scale); + } + + public int getScale() { + return getDevice().getScaleFactor(); + } + + public int scaleUp(int x) { + return x * getScale(); + } + + public int scaleDown(int x) { + return x / getScale(); } /** @@ -308,7 +321,14 @@ } public Rectangle getBounds() { - return pGetBounds(screen.getScreen()); + Rectangle rect = pGetBounds(screen.getScreen()); + if (getScale() != 1) { + rect.x = scaleDown(rect.x); + rect.y = scaleDown(rect.y); + rect.width = scaleDown(rect.width); + rect.height = scaleDown(rect.height); + } + return rect; } private native Rectangle pGetBounds(int screenNum);