openjdk-jfx icon indicating copy to clipboard operation
openjdk-jfx copied to clipboard

WIP: synchronize sceneState on scale-factor change

Open tomsontom opened this issue 6 years ago • 12 comments

refs #98

tomsontom avatar Jun 11 '18 17:06 tomsontom

I looked a bit in the codebase and WindowStage calls GlassScene.updateSceneState() (eg in setBounds) in a similar context and I don't see them getting a lock. If not mistaken this one gets called by a TkPulseListener registered in Window at line 1081.

In contrast to that the dispose-method in EmbeddedScene calls it with a lock.

tomsontom avatar Jun 15 '18 12:06 tomsontom

I'll take a closer look when I get time.

kevinrushforth avatar Jun 15 '18 12:06 kevinrushforth

I've pushed a different solution using a TkPulseListener (borrowing the scheme from WindowStage/Window)

tomsontom avatar Jun 15 '18 12:06 tomsontom

Conceptually that seems like the right idea (and one I was thinking to suggest), so I'll review it.

kevinrushforth avatar Jun 15 '18 13:06 kevinrushforth

This will need to be tested with both Swing interop (JFXPanel) and SWT interop (FXCanvas). Two questions:

  1. Can you say what testing you have done?
  2. Have you confirmed that the listener doesn't cause a memory leak?

I'll do some testing (might not be this week, since I am reviewing more urgent fixes with a tighter deadline). I'll also review the changes in more detail.

kevinrushforth avatar Jun 26 '18 23:06 kevinrushforth

Also, can you file a JBS bug for this?

kevinrushforth avatar Jun 26 '18 23:06 kevinrushforth

On 1. I‘ve tested FXCanvas moving it between HiDPI and normal DPI screens on OS X and Windows - I‘ll try JFXPanel

On 2. I remove the listener upon dispose so I can‘t see how I could introduce a memory leak with this change

tomsontom avatar Jun 27 '18 05:06 tomsontom

Need to correct - I only tested on OS X - as the hidpi fix on windows was not yet available

tomsontom avatar Jun 27 '18 05:06 tomsontom

JBS bug: JDK-8204676

kevinrushforth avatar Jul 24 '18 21:07 kevinrushforth

Have you had a chance to test on Windows yet? I can review it later this week if you are ready. Please send a review request to openjfx-dev so others can see it, too.

kevinrushforth avatar Jul 24 '18 21:07 kevinrushforth

Unfortunately no I need to bring back up my windows toolchain after changing laptops

tomsontom avatar Jul 27 '18 06:07 tomsontom

As announced in this message, the official jfx repository is moving from hg.openjdk.java.net/openjfx/jfx-dev/rt to github.com/openjdk/jfx.

This sandbox repository is being retired on 1-Oct-2019. You will need to migrate your WIP pull request to the openjdk/jfx repo if you want to continue working on it. Here are instructions for migrating your pull request. The updated CONTRIBUTING.md doc has additional information on how to proceed.

Once you have done this, it would be helpful to add a comment with a pointer to the new PR.


The new openjdk/jfx repo will be open for pull requests on Wednesday, 2-Oct-2019. I will send email to the openjfx-dev mailing list announcing this.

kevinrushforth avatar Oct 01 '19 00:10 kevinrushforth