Ubuntu – Solution for apps that don’t scale on HiDPI displays

17.044k-monitordisplay-resolutionhdpi

My laptop has a 15-inch 4k display. Almost everything works perfectly, but some applications don't scale and are too small to use. Some examples: Hipchat, Ardour, Steam, Gimp, etc.

Is there a way for me to solve this? I've seen to use xrandr to set DPI before running the app, but that seems to have no effect (or I'm doing it wrong.)

If I could fix this one problem I'd have everything working perfectly.

Also, I'm using Gnome, but the issue was the same in Unity.

Best Answer

  • As olivierb2 pointed out there is no simple, global way to accomplish this. However, I did find a way to perform window scaling on a per-app basis that works very well, but not for all applications.

    I found a script called run_scaled that acts as a front end for xpra, which is like screen for X. It basically sets up a second X server scaled to whatever you choose, runs your app, and then forwards it to your primary display. In order to use it you need to install some deps:

    sudo apt-get install xpra winswitch xvfb
    

    Install it:

    curl "https://raw.githubusercontent.com/kaueraal/run_scaled/master/run_scaled" > ~/.local/bin/run_scaled
    chmod +x ~/.local/bin/run_scaled
    

    And after that on a new shell you run your app like so:

    run_scaled someapp
    

    If you test your app(s) that you need scaled and it works you can make it a little more user friendly by copying the script to somewhere in your path and editing the .desktop file for your app so it will launch scaled from your DE.

    The downside is that this doesn't work with every app. It seemed to work fine for all of the FOSS apps I tried, but non-free apps like Steam and HipChat didn't work. Not a perfect solution, but it can help in a pinch.