NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
51.72k stars 5.89k forks source link

Ghidra icons appear chunky on high-DPI screens (Windows) #3863

Open Deltrego opened 2 years ago

Deltrego commented 2 years ago

Windows 10 scaling (needed for high-DPI screens like retina displays) causes Ghidra icons to appear smudged and chunky since Ghidra is not DPI-aware (using v10.1.1_PUBLIC but issue should apply to all versions). Changing the Java executable properties under Compatibility -> High DPI settings does not work. A workaround is to modify line 10 in ghidraRun.bat as follows:

call "%~dp0support\launch.bat" bg Ghidra "%MAXMEM%" "-Dsun.java2d.uiScale=1.0" ghidra.GhidraRun %*

Icons are then displayed in their original resolution. A programmatic solution could be Abra's answer here: https://stackoverflow.com/questions/64586078/java-swing-jbutton-jlabel-icons-are-not-displayed-in-their-original-size Not sure if SVG icons or higher-res bitmaps would scale properly without changing the code.

dev747368 commented 2 years ago

Two points.

1) support/launch.properties should have an entry for "-Dsun.java2d.uiScale". By default its commented out, but if you find yourself in need of setting this value, this is the best place to do it.

2) Java added support for multi-res icons (where the application supplies pre-scaled versions of a single icon and lets the java graphic rendering subsystem choose the best one for the current scaling). Ghidra isn't taking advantage of this yet, but that is likely the route we will take when we address this.

sfjuocekr commented 1 year ago

Missing hidpi support on Linux as well.