Template selection box does not render correctly on HiDPI displays with scaling (Linux - Debian)
Is there an existing issue for this?
- [x] I have searched the existing issues
Description of the bug
My monitor is 4K, with 3840x2160 resolution. I use 200% scaling in Cinnamon (so Linux Mint users with HiDPI monitors will likely also be affected). GUI doesn't render fonts in some selector windows correctly.
Steps To Reproduce
- Buy 4K monitor
- Set HiDPI/scaling to suit the tiny pixels and make everything readable and pretty
- Run
ardupilot_methodic_configurator - Click "Skip FC connection.."
- Click selector under "Source Template directory:"
- Observe incorrectly spaced text and obscured text
If I set display scaling back to 100% (which makes everything look tiny), then that selector renders correctly.
Expected behavior
Ideally ardupilot_methodic_configurator would play nice with HiDPI/Scaled displays. I realise this may not be easy with the chosen GUI software.
Screenshots / Logs
Fonts in the template selection screen look like this:
Software information
- Operating system: Debian GNU/Linux 12 (bookworm) x86_64 with Cinnamon desktop environment
- arduPilot Methodic Configuration version: 1.4.8
Additional context
No response
Not a problem here, but it could be a DPI thing on your side.
EIZO 27" with
~$ inxi -Fz
System:
Kernel: 6.1.0-37-amd64 arch: x86_64 bits: 64 Desktop: Xfce v: 4.18.1
Distro: Debian GNU/Linux 12 (bookworm)
Machine:
Type: Desktop Mobo: ASUSTeK model: PRIME X370-A v: Rev X.0x
serial: <superuser required> UEFI: American Megatrends v: 6232
date: 09/29/2024
CPU:
Info: 8-core model: AMD Ryzen 7 5700G with Radeon Graphics bits: 64
type: MT MCP cache: L2: 4 MiB
Speed (MHz): avg: 2446 min/max: 1400/3800 cores: 1: 1400 2: 2399 3: 3223
4: 1400 5: 3250 6: 1400 7: 3284 8: 3568 9: 1400 10: 1400 11: 3027 12: 1400
13: 3800 14: 1400 15: 3800 16: 2999
Graphics:
Device-1: NVIDIA GP108 [GeForce GT 1030] driver: nvidia v: 535.247.01
Display: x11 server: X.Org v: 1.21.1.7 driver: X: loaded: nvidia
unloaded: fbdev,modesetting,nouveau,vesa gpu: nvidia
resolution: 1920x1080~60Hz
API: OpenGL v: 4.6.0 NVIDIA 535.247.01 renderer: NVIDIA GeForce GT
1030/PCIe/SSE2
Tried to run DEBIAN 12 in general with a NUC on our 55" 4K TV. WIN 11 is OK, but DEBIAN is a hassle and I finally gave up. Don't think, it is a MethodicConfigurator problem.
@Merga189 1920x1080 on a 27" display is not HiDPI and doesn't require display scaling to be readable. Also Xfce desktop environment is a long way removed from Cinnamon (which uses a compositor with hardware acceleration).
I've been using Linux on the desktop for over 20 years, and would concede that Debian isn't the ideal place to start. Suggest Linux Mint if you're looking for something a bit friendlier.
ETA: I suspect this is an issue with TKinter not detecting HiDPI and setting suitable scaling.
Therefore I am with my applications on such a small screen. And with Xfce, because it keeps things simple. Started with Kubuntu, then PCLos, changed to Debian starting with Wheezy, Jessie and Stretch and so on. Had LM one year on a TP some years ago, but LM is too much beating around the bush (for me).
Might find help at https://www.python.org/community/forums/
Found great help there when struggling building AP under Debian from the sources last year .....
Hope you get that issue solved - br
See file ardupilot_methodic_configurator/frontend_tkinter_template_overview.py line 89 to 134
@amilcarlucas thanks for giving this your attention. Unfortunately #571 does not seem to have resolved this issue on my HiDPI setup. My laptop runs the same desktop environment, without HiDPI, and the template selection box renders correctly there.
I installed using
pip install git+https://github.com/ArduPilot/MethodicConfigurator.git@master
so I presume that should include #571 ?
Can you post a new screenshot? I tested it at different DPI on windows and it worked fine.
I suspect Windows and Cinnamon on Linux handle scaling in different ways.
Linux thinks the monitor is 96dpi. "Monitor Scale" display setting in Cinnamon is set to 200%. Default fonts are 9-11 pt, and "Text Scaling Factor" is 1.0.
> xdpyinfo | grep -B 2 resolution
screen #0:
dimensions: 3840x2160 pixels (1016x571 millimeters)
resolution: 96x96 dots per inch
Actual monitor screen size is approximately 62x34cm. Obviously 62cm != 42 inches | 1016 mm. Actual DPI is roughly 160.
Thanks, I will try to reproduce it on Ubuntu 20.04 LTS
I could not reproduce it, but I did change the way the fonts work on release 2.0.4. Please re-test.
Thanks. I've re-tested with 2.0.4 and the same issue persists. I'll probably upgrade to Debian 13 soon, so I'll try again after that upgrade.