gluonhq / scenebuilder

Scene Builder is a visual, drag 'n' drop, layout tool for designing JavaFX application user interfaces.
https://gluonhq.com/products/scene-builder/
Other
708 stars 218 forks source link

Linux HIDPI support #66

Open gluon-bot opened 8 years ago

gluon-bot commented 8 years ago

Originally reported by: Karel Van Hecke (Bitbucket: karelvanhecke, GitHub: karelvanhecke)


The application is completely unusable with a high resolution display. Since it already has HiDPI scaling on Windows, would it be possible to add HiDPI scaling on linux?


gluon-bot commented 6 years ago

Original comment by Bart van der Bilt (Bitbucket: bbplotters, GitHub: Unknown):


JavaFX9 is released with HiDPi scaling on Linux. Why doesn't it work?

gluon-bot commented 7 years ago

Original comment by Frederik Bertling (Bitbucket: Burtan, GitHub: Burtan):


I agree that the Scenebuilder is not useable on 4k Linux. However, scaling on Windows and Mac is not achieved by SceneBuilder but by JavaFX. Thus we have to wait until javaFX supports scaling on Linux (scheduled for JavaFX9 afaik) or that Gluon implements custom css scaling for Linux (unlikely to hapen)

amalic commented 2 years ago

Any news when this will be fixed?

Here's my workaround for Ubuntu 20.04 LTS based on this Oracle ticket.

I ended up adding a shell-script which launches SceneBuilder after setting GDK_SCALE environment variable.

sudo nano /opt/scenebuilder/bin/SceneBuilderLauncher.sh

#!/bin/bash

export GDK_SCALE=2
/opt/scenebuilder/bin/SceneBuilder "$@"

Then made it executable sudo chmod +x /opt/scenebuilder/bin/SceneBuilderLauncher.sh

And finally changed what the desktop-launcher is starting sudo nano /usr/share/applications/scenebuilder-SceneBuilder.desktop

[Desktop Entry]
Name=SceneBuilder
Comment=Scene Builder
Exec=/opt/scenebuilder/bin/SceneBuilderLauncher.sh
Icon=/opt/scenebuilder/lib/SceneBuilder.png
Terminal=false
Type=Application
Categories=Unknown
MimeType=

I am doing the same in my IDE's launch configs for JavaFX apps.

abhinayagarwal commented 2 years ago

@amalic The oracle ticket linked by you has been fixed in OpenJFX 17. Can you still reproduce the issue while running Scene Builder with JavaFX 17-ea builds?

amalic commented 2 years ago

Yes. I think it has to do with fractional scaling. GDK_SCALE is per default set to 1.25. My guess is that JavaFX converts it to an integer?

abhinayagarwal commented 2 years ago

Strange, I can't reproduce the issue when using 125% scaling on Ubuntu 20.04.2 LTS and running from master on JavaFX 17-ea+14.

amalic commented 2 years ago

Really strange. Maybe it's a driver or version thing (NVidia CUDA drivers, Open JDK 16, ...). Or my second screen which is rotated by 90°>

abhinayagarwal commented 2 years ago

How are you running Scene Builder?

amalic commented 2 years ago

I installed the Debian package via apt install. Running it via provided Ubuntu desktop launcher, except for my scaling fix.

abhinayagarwal commented 2 years ago

Hi @amalic ,

Debian package comes with JavaFX version 16. Can you run Scene Builder JavaFX 17-ea+14 to check if the issue is resolved?

Just follow these steps:

  1. Clone scenebuillder repository
  2. Update JavaFX version in root pom.xml to 17-ea+14
  3. run mvn install && mvn javafx:run -f app