JDK-8163100 : [hidpi] Linux: display-wise scaling factor issues
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-08-03
  • Updated: 2016-09-22
  • Resolved: 2016-09-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b137Fixed
Related Reports
Relates :  
Description
The issue is connected to JDK-8149115

Config.: Ubuntu 16.04 Linux + HiDPI machine.

Please run the attached test code with e.g. b128 - the menu icons will be red as expected (if GDK_SCALE wasn't set explicitly).

Then please run the same test with current client build (I used b130 nightly) having display scaling factor = 2. The icons are blue (as expected). But nothing changes dynamically if set it to 1 - the icons are still blue. And even after the test restart the icons are still blue. Please note also that rerun with GDK_SCALE does not change anything (while it works for the pre-fix JDK) - is it what intended?

The issue is more notable in case of two-display configuration - the icon's color does not change when dragging the test window from one display to another (having different scale values, say 1 and 2). The option "Scale all window contents to match" (from "Display" settings) does not have effect at all ("Display with smallest/largest controls" etc).

If try to set scale = 1 for both the displays and rerun then the test. The icons will be red (ok).
Then disconnect the 2nd display and set the scale for the 1st to 2. Nothing changed. I wasn't able to obtain the blue icons again playing with the 1st display settings and even restarting the test; to fix it I was forced to connect the 2nd display again and set scale = 2 for both the displays.

So it seems this feature works very "statically" (and not very regularly).
Comments
That is probably because the scale notification is ignored. As I wrote above this will be fixed and JDK scale will track the system scale as well as native apps.
30-08-2016

It seems that scale for different screens doesn't work for native apps as well. Actually, they use the same scale as the main monitor uses. Different scale only affects system tooolbars and window titles height. the next bug is open for long time: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1528319 There is a workaround to work with different dpi that uses xrandr scaling. But xrandr scaling is not a true hidpi because it does not allow to use the true resolution. So I think we can forget about the idea to support different scales at least for 9. I will change the code to use only the scale obtained for the main screen. The "hot" scale changing is supported natively and will be fixed.
30-08-2016

JDK-8163101 was also discovered when running the test
03-08-2016