UI Scaling on Linux

I am new to JUCE. I built the Projucer and found it was very small on my 4k display. I use GNOME. I dug into the source code and found a couple issues for my situation. Looking at getDisplayScale in juce_XWindowSystem_linux.cpp, first it tries to use xSettings which returns 1, but I don’t think GNOME uses that for scaling. So I put that at the end of the function instead of first. After checking xSettings, it then checked for an ubuntu specific setting using dconf, and if that failed, it would try gsettings for GNOME. However, the gsetting that it checks is not what I’m using to scale things which is the text-scaling-factor at /org/gnome/desktop/interface/text-scaling-factor in dconf. So I used dconf to read and return that value, and everything scales well for me.

I have a patch if you’d like me to submit a pull request with what I did.

1 Like