RFR: JDK-8222209: Repaint properly when JFXPanel moves to another screen

Kevin Rushforth kcr at openjdk.org
Sat Jul 29 15:15:44 UTC 2023


On Fri, 28 Jul 2023 09:26:35 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> Alternative fix for JFXPanel issues.
> 
> I added an extra line to **really** trigger the repainting in `EmbeddedScene`.  This was inspired by this code in `GlassWindowEventHandler` which reacts to `WindowEvent.RESCALE`.  It not only calls `entireSceneNeedsRepaint` but also `updateSceneState`.  Snippet:
> 
>             case WindowEvent.RESCALE: {
>                 float outScaleX = window.getOutputScaleX();
>                 float outScaleY = window.getOutputScaleY();
>                 stage.stageListener.changedScale(outScaleX, outScaleY);
>                 // We need to sync the new scales for painting
>                 QuantumToolkit.runWithRenderLock(() -> {
>                     GlassScene scene = stage.getScene();
>                     if (scene != null) {
>                         scene.entireSceneNeedsRepaint();
>                         scene.updateSceneState();
>                     }
>                     return null;
>                 });
>                 break;
>             }

Moving this to Draft, since we will likely end up folding this into #1171

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

PR Comment: https://git.openjdk.org/jfx/pull/1189#issuecomment-1656755682


More information about the openjfx-dev mailing list