Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High DPI support (Linux) #251

Open
t0mmyt opened this issue Sep 28, 2015 · 24 comments
Open

High DPI support (Linux) #251

t0mmyt opened this issue Sep 28, 2015 · 24 comments
Labels
Status: Reproduced For issues that are (critical) bugs, denotes that the bug is reproduced, but no further action taken Type: Bug Indicates that Protege is not working as expected

Comments

@t0mmyt
Copy link

t0mmyt commented Sep 28, 2015

I'm not sure if this counts as a bug or a feature request but Protege is almost unusable on a high resolution screen. If scaling is set in GTK and the GTK "theme" is used then some elements scale but most still do not.

I've attached screenshots of Protege default and GTK. My resolution is 3200x1800 on a 13" screen. WM is Gnome 3.16 with High DPI scaling set to 2.

protege-classic
protege-gtk

@scossu
Copy link

scossu commented Oct 1, 2015

Same issue here. XFCE with DPI set to 280, all other applications look fine.

After looking online, the issue seems to be related more generally to Swing, and this is confirmed by other Swing apps that I run and have the same issue, but I cannot tell much more because I am not a Java developer.

OS X seems to have much better support for Java/Swing on HiDPI. On MacBook Retina Protege looks good.

@matthewhorridge
Copy link
Contributor

Closing because this is a Java/Swing issue and not a Protege issue.

@louwers
Copy link

louwers commented Oct 4, 2016

@csnyulas
Copy link
Member

Here are a few potential leads for overcoming this problem (needs to be tested and validated):
http://stackoverflow.com/questions/15659044/how-to-set-the-dpi-of-java-swing-apps-on-windows-linux
https://superuser.com/questions/988379/how-do-i-run-java-apps-upscaled-on-a-high-dpi-display
http://stackoverflow.com/questions/28673127/how-can-i-scale-fonts-on-a-high-resolution-screen
Google has many more results...

If anyone can confirm which, if any, of this solution has worked for them for Protégé that would be really great.

Note: The Protégé Look and Feel (L&F) can be set using the Window -> Look & Feel menu.

@lsarni
Copy link

lsarni commented Jan 12, 2018

Anyone has managed to fix this? I have tried JDK 9, the custom manifest and a few other solutions without any luck

@nlappas
Copy link

nlappas commented Mar 8, 2018

Problem still here

@louwers
Copy link

louwers commented Mar 8, 2018

Can this be re-opened?

@matthewhorridge
Copy link
Contributor

Sure, reopening this.

@nlappas
Copy link

nlappas commented Jul 25, 2018

Any workaround?

@matthewhorridge matthewhorridge added Type: Bug Indicates that Protege is not working as expected Status: Reproduced For issues that are (critical) bugs, denotes that the bug is reproduced, but no further action taken labels Jan 15, 2019
@matthewhorridge
Copy link
Contributor

@nlappas @lsarni @louwers please could you take a look at Protege 5.5.0-beta-8 and let me know if this improves things? Thank you.

@lsarni
Copy link

lsarni commented Jan 17, 2019

It has changed but not improved on Windows:

5.2
5 2

Beta 5
beta 5

Beta 8
beta 8

@matthewhorridge
Copy link
Contributor

@lsarni this is really helpful, thanks. What does the class hierarchy look like? Is it still tiny?

@lsarni
Copy link

lsarni commented Jan 17, 2019

Still tiny @matthewhorridge

5.2
5 2

Beta 5
beta 5

Beta 8
beta 8

@matthewhorridge
Copy link
Contributor

@lsarni good to know. Thank you very much for your help. Much appreciated.

@bututoubaobei
Copy link

I have solved the problem by decrease the resolution of my windows 10 (originally it is 38402160, after changed, it is 1600900)

@eyusupov
Copy link

eyusupov commented Nov 27, 2019

Adding -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel to run.sh (or CMDLINE env var) solved this for me on Linux

@atextor
Copy link

atextor commented Mar 5, 2020

@eyusupov Which Protégé version and JRE version did you use?

@eyusupov
Copy link

@atextor just tried it again.

Starting Protege 4 OWL Editor (Version 4.3.0, Build = 304)
Platform:
    Java: JVM 1.8.0_252-b09 Memory: 466M
    Language: en, Country: US
    Framework: Apache Software Foundation (1.9)
    OS: linux (5.6.11.300_fc32_x86_64)
    Processor: x86-64

$ /usr/bin/java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Still works.
I edited run.sh like this:

java -Xmx500M -Xms250M \
     -server \
     -Dlog4j.configuration=file:log4j.xml \
     -DentityExpansionLimit=100000000 \
     -Dfile.encoding=UTF-8 \
     -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel \
     -classpath bin/felix.jar:bin/ProtegeLauncher.jar \
     org.protege.osgi.framework.Launcher \

@Dzeri96
Copy link

Dzeri96 commented Nov 5, 2020

@atextor just tried it again.

Starting Protege 4 OWL Editor (Version 4.3.0, Build = 304)
Platform:
    Java: JVM 1.8.0_252-b09 Memory: 466M
    Language: en, Country: US
    Framework: Apache Software Foundation (1.9)
    OS: linux (5.6.11.300_fc32_x86_64)
    Processor: x86-64

$ /usr/bin/java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Still works.
I edited run.sh like this:

java -Xmx500M -Xms250M \
     -server \
     -Dlog4j.configuration=file:log4j.xml \
     -DentityExpansionLimit=100000000 \
     -Dfile.encoding=UTF-8 \
     -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel \
     -classpath bin/felix.jar:bin/ProtegeLauncher.jar \
     org.protege.osgi.framework.Launcher \

This does not seem to work on Kubuntu 20.10

@haoyun
Copy link

haoyun commented Mar 3, 2021

Two not-so-perfect solutions:

  1. as mentioned above, use -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel plus
    a) -Dsun.java2d.uiScale=2, OR
    b) export GDK_SCALE=2
  2. use https://github.com/kaueraal/run_scaled

@donpellegrino
Copy link

donpellegrino commented Nov 1, 2022

Workaround for Microsoft Windows

For Windows 11 Enterprise 21H2 I found this answer useful: https://superuser.com/a/1207925. From the Protege directory, the jre/bin/java.exe is the file to change the Compatibility settings on. I used the "System (Enhanced)" setting and that seemed to reduce some of the fuzziness of the rendering seen using the "System" setting.

The root cause of this issue seems to be the limitations of the JRE version packaged with Protege Desktop for Windows.

@renyuneyun
Copy link

renyuneyun commented Apr 4, 2023

I'm using Wayland, and tried the above methods, but (almost) none made a difference for HiDPI. The only way that made a difference is to use run_scaled, which it has its own problems as well (e.g. resource consumption, not playing well with my existing scaling configuration, etc).

In particular, run_scaled basically started a separate X session and started protege within it. It seems setting the scaling factors for protege (-Dsun.java2d.uiScale=2 or export GDK_SCALE=2) will be combined with my existing scaling factor (for X and Wayland, not sure which), when used with run_scaled, leading to the UI exceptionally huge.

(As environmental information: my some other Java application would scale correctly with -Dglass.gtk.uiScale=200%, directly with Wayland. Though it uses JavaFx and Java 14.)

@knbknb
Copy link

knbknb commented Jun 8, 2023

On Linux using Protege 5.6.1, (which comes with its own Java 11 JRE), I have changed the first 1 lines in run.sh
from this

#!/usr/bin/env bash

to this

#!/usr/bin/env bash
export GDK_SCALE=2

and the GUI becomes usable again;

This hack does not fix the GUI scaling problems for 5.5.0 which comes with its own Java 8 (and older GUI libraries?). Protege 5.5.0 is still displayed with tiny fonts.

@miguelrgonzalez
Copy link

version 5.6.3 had the same issue in Linux.
It can be solved by adding this to the conf file at (I had to create the conf folder) : ~/.Protege/conf/jvm.conf

append=-Dsun.java2d.uiScale=2

And setting window->Look & feel -> Protégé

Cleaner than modifying the run script and it should also survive tool upgrades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reproduced For issues that are (critical) bugs, denotes that the bug is reproduced, but no further action taken Type: Bug Indicates that Protege is not working as expected
Projects
None yet
Development

No branches or pull requests