On Thu, 27 Jul 2023 17:50:11 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

> This is how I understand this works:
> 
> The `JFXPanel` makes use of an `EmbeddedWindow` that is a subclass of 
> `Window`. This window listens to its `showing` property, and when it becomes 
> visible will call `updateOutputScales`; this will in turn set the (correct?) 
> render scales.
> 
> Now the above fix seems to 2nd guess this logic, and overrides these values 
> with render scales it gets from Swing/AWT (note that it didn't do this 
> before).
> 
> So, my questions:
> 
>     * If JFXPanel never called setRenderScale before, was the JFXPanel 
> completely broken when used on monitors that are not set at 100% scale? Did 
> they update correctly when moved between monitors?  I get the impression that 
> it sort of worked, except for this edge case.
> 
>     * If it wasn't completely broken, then why is this fix needed?  Shouldn't 
> `Window` already detect that it has become visible (with its `showing` 
> listener) and update the render scales using the `updateOutputScales` method? 
>  In other words, isn't this a bug that perhaps needs to be fixed in `Window`s 
> detection of when it should be updating the output scales?

I think it is broken...See 
[JDK-8222209](https://bugs.openjdk.org/browse/JDK-8222209)
I am not sure if it might be a bug in FX Embedded `Window` s detection logic 
and scale updation logic, might be FX windows-graphics/toolkit team can share 
their thoughts but I guess it's not as otherwise we will get lot more issues 
and not just in JFXPanel.
Also, JFXPanel uses `GraphicsEnvironment.getLocalGraphicsEnvironment().         
                     
getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleX()`
 which only works for primary screen and will not work if secondary screen has 
different scale, so that needs to be fixed in my opinion, which is being done 
in this PR.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1171#issuecomment-1654959756

Reply via email to