-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Ghidra does not render correctly with GDK_SCALE set (HiDPI display) #1
Comments
setting the java2d.uiscale also results in the same |
I tried to find somewhere to jerry-rig a fix, but no luck yet. The clipping is clearly relative to the size of the container window, so I bet this is a single line of code somewhere that somehow is fetching unscaled dialog widths and copying the result to a scaled width (but finding that line escapes me! looks like it's under docking/ somewhere. ./ghidra/app/plugin/core/totd/TipOfTheDayDialog.java shows the classes involved for the tip of the day dialog |
Another option is to use |
See https://github.com/bkerler/ghidra_installer Tested and verified to work with Ubuntu / Kubuntu 18.04 and 18.10. |
Having spent some time debugging this I'm starting to suspect it is an Xlib scaling issue in openjdk itself. All the window->jframe->jpanel hierarchies seem sized properly (at a quotient of the scaling factor) and should be scaled up consistently, but clearly some root view port's scaled size is being used as a literal resolution (thus the clipping). I'm no java swing expert, but all the layout manager logic seems kosher to me as well. I dumped the actual window components, and they all seem correct and as expected throughout the hierarchy. e.g. on a 3200x1800 screen, and a scale factor of 2.0: Which is what what you would expect to see, as openjdk itself is responsible for scaling up the scaled down resolutions for final display, but it seems at some root component this is not happening, and thus the displayed scaled output is clipped. I suspect it's a corner case in openjdk's Linux specific XLib scaling since Ghidra scales fine on Windows HIDPI and OSX HIDPI. Unless I missed something I did not immediately see a simple fix in Ghidra itself. |
On my laptop, adding GDK_SCALE=2 to "launch.properties" will enlarge about half of the UI text, and does nothing for resizing icons. I don't experience any clipping, everything seems to come up, but the inconsistency in text size makes the program unusable. I'm running Centos 7, Gnome 3.28.2. |
Would someone with this problem mind testing Ghidra against Amazon Corretto 11 to see if they've done anything to address it? I don't have a setup to reproduce the problem. Thanks! |
I'll test against Coretto in a bit and report back. |
Tested with java-11-amazon-corretto-devel-11.0.2.9-3.x86_64.rpm and the issue persists. I believe this will probably require openjdk team support once the UI test case is isolated since it's almost certainly an issue with the Linux specific xlib scaling (there's a history of this kind of thing happening with the Linux specific scaling code). This is further supported with the native OSX version scaling fine on Retina screens (not driven by the xlib scaling code). |
Ok thanks for following up. Issue #161 reported some success switching from OpenJDK to Oracle JDK with another linux/graphics problem, so I figured it was worth a shot. |
I did try with both oracle java 8 and oracle java 11 as well just in case, but no dice. |
I found this in
|
D'oh! I can confirm that fixes the issue for me as well. |
same here, it's fixed! |
can confirm aswell, in combination with |
I updated launch.properties to indicate that |
(#1). Also no longer recommending official OpenJDK 11 since it's not LTS. Recommending AdoptOpenJDK or Amazon Corretto.
The proposed solution does not work for me. With both |
What distro are you using? |
Manjaro (based on Archlinux) |
|
* fix package declarations * don't special-case defined symbols with zero value a.out object files can define symbols at the very start of a section. * mark undefined symbols with non-zero value as bss candidates * use FSRL to get filename This is required when invoking loaders on subsets of files, such as bulk-importing object files from static archives. * don't use filename in memory block names
Fix parsing of recoverable malformed datatypes
100% perfect workaround: #1 (comment)
Describe the bug
On HiDPI displays on Linux, it is necessary to set GDK_SCALE= for a reasonable experience with OpenJDK apps, but setting this variable causes clipping of UI elements in every window.
To Reproduce
Expected behavior
Neatly scaled UI
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: