macOS has flexibility in changing monitor resolution, but it can cause some problems.
What I encountered:
I have a monitor with a 3840x2160 resolution, but the system has 2304x1296 selected for correct scaling. In this case, JavaFX reports that the monitor resolution is 2304x1296, and the dpi is 2x, but the real is 1.5x. Because of this, the openglfx renders at a higher resolution and then shrink to the correct size.
It is impossible to get the actual monitor size through JavaFX (at least on macOS), so I have to use native code.
macOS has flexibility in changing monitor resolution, but it can cause some problems.
What I encountered: I have a monitor with a 3840x2160 resolution, but the system has 2304x1296 selected for correct scaling. In this case, JavaFX reports that the monitor resolution is 2304x1296, and the dpi is 2x, but the real is 1.5x. Because of this, the openglfx renders at a higher resolution and then shrink to the correct size.
It is impossible to get the actual monitor size through JavaFX (at least on macOS), so I have to use native code.