Skip to content

Screen window sizing is not respected in JavaFX 21 #3436

Description

@rjwills28

I have noticed a problem when using the command line to open a screen in a new window which specifies the size of that screen.

The command I use is:

phoebus.sh -resource  file:/home/xxx/bob/standalone1.bob?target=window@600x600+800+150

I would expect the size to be 600x600 but instead it always opens much smaller. No matter what value I specify for the screen size, this is what I get:

Image

Interestingly I do not see this issue in Phoebus v4.7.3. I have pinned it down to an issue in JavaFX that was not there in JavaFX 19 but is in JavaFX 21. It also depends on the gnome version being used - I have tested on Ubuntu24.04 and Fedora41 - both using later versions of gnome. Yet, the problem is not there in any version of Phoebus on RedHat 7 (using a much older version of gnome).

Here you can find the bug report: https://bugs.openjdk.org/browse/JDK-8316423 and the associated fix in JavaFX: openjdk/jfx#1249. You can see it is consistent with my finding that it affects later versions of gnome as the underlying change came from an update to mutter.

FIX OPTIONS:

  • The above fix is available in JavaFX 22 but not 21, therefore one solution to fix this in Phoebus would be to update to JavaFX22 which still requires JDK17 (JavaFX 23 would required JDK21).
  • Alternatively, if this isn't an option, a workaround is to set the stage height and width after the stage has been created, i.e. after stage.show() at line 173:
    add:
    stage.setWidth(geometry.width);
    stage.setHeight(geometry.height);
    

What do people think is the best way forward here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions